X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftime%2Ftimedelta.h;h=1a4274ba3a35c05822ad6f18c43775cf02e592e4;hb=01844ee2ba101c25655dd5eacf62ca9365f26f21;hp=2ce6eeb4e9e42d3d48db4a6d908d0c18c480810c;hpb=ab9e61f0bc6ed09dae52f538dc6927c54b9216df;p=libs%2Fcore.git diff --git a/source/time/timedelta.h b/source/time/timedelta.h index 2ce6eeb..1a4274b 100644 --- a/source/time/timedelta.h +++ b/source/time/timedelta.h @@ -15,11 +15,11 @@ Represents a quantity of time, such as five seconds. class TimeDelta { private: - RawTime usec; + RawTime usec = 0; public: /** Constructs a zero TimeDelta. */ - TimeDelta(): usec(0) { } + TimeDelta() = default; /** Constructs a TimeDelta from a plain number. The purpose of this is to allow serialization together with the raw() function. */ @@ -54,7 +54,7 @@ public: bool operator==(const TimeDelta &t) const { return usec==t.usec; } bool operator!=(const TimeDelta &t) const { return usec!=t.usec; } - operator const void *() const { return usec ? this : 0; } + explicit operator bool() const { return usec; } }; template