From 7f68de063c2fb85a203abb5e99aabf0bb6037193 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Fri, 21 Sep 2012 19:31:51 -0400 Subject: [PATCH] added += time operations --- include/fc/time.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/fc/time.hpp b/include/fc/time.hpp index 247297e..04b55b0 100644 --- a/include/fc/time.hpp +++ b/include/fc/time.hpp @@ -10,6 +10,7 @@ namespace fc { friend microseconds operator + (const microseconds& l, const microseconds& r ) { return microseconds(l._count+r._count); } bool operator==(const microseconds& c)const { return _count == c._count; } + microseconds& operator+=(const microseconds& c) { _count += c._count; return *this; } int64_t count()const { return _count; } private: friend class time_point; @@ -30,6 +31,7 @@ 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 microseconds operator - ( const time_point& t, const time_point& m ) { return microseconds(t.elapsed.count() - m.elapsed.count()); } private: