From af77f4dc4b583413b8334a95f55eb4311d4c72b0 Mon Sep 17 00:00:00 2001 From: vogel76 Date: Sat, 1 Feb 2014 14:41:02 +0100 Subject: [PATCH] [BW]: [Fix] Fixed gcc compile errors --- include/fc/time.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/include/fc/time.hpp b/include/fc/time.hpp index c5ae58a..adde1c0 100644 --- a/include/fc/time.hpp +++ b/include/fc/time.hpp @@ -36,7 +36,7 @@ namespace fc { explicit time_point( microseconds e = microseconds() ) :elapsed(e){} static time_point now(); static time_point maximum() { return time_point( microseconds::maximum() ); } - static time_point (min)() { return time_point(); } + static time_point min() { return time_point(); } operator fc::string()const; static time_point from_iso_string( const fc::string& s ); @@ -48,10 +48,10 @@ namespace fc { bool operator <=( const time_point& t )const { return elapsed._count <=t.elapsed._count; } bool operator ==( const time_point& t )const { return elapsed._count ==t.elapsed._count; } bool operator !=( const time_point& t )const { return elapsed._count !=t.elapsed._count; } - time_point& operator += ( const microseconds& m ) { elapsed+=m; return *this; } - friend time_point operator + ( const time_point& t, const microseconds& m ) { return time_point(t.elapsed+m); } - friend time_point operator - ( const time_point& t, const microseconds& m ) { return time_point(t.elapsed-m); } - friend microseconds operator - ( const time_point& t, const time_point& m ) { return microseconds(t.elapsed.count() - m.elapsed.count()); } + time_point& operator += ( const microseconds& m) { elapsed+=m; return *this; } + time_point operator + (const microseconds& m) const { return time_point(elapsed+m); } + time_point operator - (const microseconds& m) const { return time_point(elapsed-m); } + microseconds operator - (const time_point& m) const { return microseconds(elapsed.count() - m.elapsed.count()); } private: microseconds elapsed; }; @@ -86,6 +86,8 @@ namespace fc { friend bool operator == ( const time_point_sec& a, const time_point_sec& b ) { return a.utc_seconds == b.utc_seconds; } time_point_sec& operator += ( uint32_t m ) { utc_seconds+=m; return *this; } + microseconds operator - (const time_point_sec& rhs) const { return microseconds(utc_seconds - rhs.utc_seconds);} + private: uint32_t utc_seconds; };