conv.result(result);
}
-const TimeDelta zero(0);
-const TimeDelta usec(1);
-const TimeDelta msec(1000);
-const TimeDelta sec(1000000);
-const TimeDelta min(60*1000000);
-const TimeDelta hour(3600*1000000LL);
-const TimeDelta day(86400*1000000LL);
-const TimeDelta week(7*86400*1000000LL);
-
} // namespace Time
} // namespace Msp
public:
/** Constructs a zero TimeDelta. */
- TimeDelta() = default;
+ constexpr TimeDelta() = default;
/** Constructs a TimeDelta from a plain number. The purpose of this is to
allow serialization together with the raw() function. */
- explicit TimeDelta(RawTime u): usec(u) { }
+ explicit constexpr TimeDelta(RawTime u): usec(u) { }
/** Returns the raw number stored inside the TimeDelta. This should only be used
for serialization and the result should not be interpreted in any way. */
// Constants to be used in creation of TimeDeltas
-MSPCORE_API extern const TimeDelta zero;
-MSPCORE_API extern const TimeDelta usec;
-MSPCORE_API extern const TimeDelta msec;
-MSPCORE_API extern const TimeDelta sec;
-MSPCORE_API extern const TimeDelta min;
-MSPCORE_API extern const TimeDelta hour;
-MSPCORE_API extern const TimeDelta day;
-MSPCORE_API extern const TimeDelta week;
+constexpr TimeDelta zero(0);
+constexpr TimeDelta usec(1);
+constexpr TimeDelta msec(1000);
+constexpr TimeDelta sec(1000000);
+constexpr TimeDelta min(60*1000000);
+constexpr TimeDelta hour(3600*1000000LL);
+constexpr TimeDelta day(86400*1000000LL);
+constexpr TimeDelta week(7*86400*1000000LL);
inline TimeDelta abs(const TimeDelta &t) { return t>=zero ? t : -t; }
using std::abs;