]> git.tdb.fi Git - libs/core.git/blobdiff - source/time/timedelta.h
Mark boolean conversion operators as explicit
[libs/core.git] / source / time / timedelta.h
index 332683533cad5e3fea5e076360bb50fb2fa1714c..1a4274ba3a35c05822ad6f18c43775cf02e592e4 100644 (file)
@@ -19,7 +19,7 @@ private:
 
 public:
        /** Constructs a zero TimeDelta. */
-       TimeDelta() { }
+       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<typename T>