10 template<
class Clock_,
class Dur =
typename Clock_::Duration>
21 constexpr
explicit TimePoint(
const Duration& d) : _dur(d) {}
26 template<
class Clock2,
class Dur2>
31 template<
class Clock2,
class Dur2>
44 constexpr
bool operator<(const TimePoint<Clock,Dur2>& rhs)
const {
return _dur < rhs._dur; }
50 constexpr
bool operator<=(const TimePoint<Clock,Dur2>& rhs)
const {
return !(rhs < *
this); }
56 constexpr Duration
time()
const {
return _dur; }
72 template<
class Clock,
class Dur,
class Rep,
class Period,
73 class TimeCommon = TimePoint<Clock, typename std::common_type<Dur, Duration<Rep,Period>>::type>>
76 return TimeCommon(lhs.
time() + rhs);
79 template<
class Clock,
class Dur,
class Rep,
class Period,
86 template<
class Clock,
class Dur,
class Rep,
class Period,
93 template<
class Clock,
class Dur,
class Dur2,
94 class DurCommon =
typename std::common_type<Dur, Dur2>::type>
TimePoint & operator-=(const Duration &rhs)
Definition: TimePoint.h:35
TimePoint represented by a duration since a clock's epoch time.
Definition: TimePoint.h:11
static constexpr TimePoint min()
Minimum time point (negative duration)
Definition: TimePoint.h:59
constexpr TimeCommon operator-(const TimePoint< Clock, Dur > &lhs, const Duration< Rep, Period > &rhs)
operator-(TimePoint, Duration). Returns a time point of best-fit duration.
Definition: TimePoint.h:88
Clock_ Clock
Definition: TimePoint.h:15
constexpr bool operator!=(const TimePoint< Clock, Dur2 > &rhs) const
Definition: TimePoint.h:41
TimePoint & operator=(const TimePoint< Clock2, Dur2 > &rhs)
Definition: TimePoint.h:32
constexpr TimePoint(const Duration &d)
Construct with a duration from clock's epoch.
Definition: TimePoint.h:21
static constexpr TimePoint max()
Maximum time point (positive duration)
Definition: TimePoint.h:61
constexpr TimePoint()
Initialized to zero time, the clock's epoch.
Definition: TimePoint.h:19
constexpr TimePoint(const TimePoint< Clock, Dur2 > &t)
Construct from a time point with the same clock but different duration.
Definition: TimePoint.h:24
TimePoint(const TimePoint< Clock2, Dur2 > &t)
Construct from a different clock.
Definition: TimePoint.h:27
constexpr bool operator==(const TimePoint< Clock, Dur2 > &rhs) const
Definition: TimePoint.h:38
constexpr bool operator>(const TimePoint< Clock, Dur2 > &rhs) const
Definition: TimePoint.h:47
Dur Duration
Definition: TimePoint.h:16
constexpr TimeCommon operator+(const Duration< Rep, Period > &lhs, const TimePoint< Clock, Dur > &rhs)
operator+(Duration, TimePoint). Returns a time point of best-fit duration.
Definition: TimePoint.h:81
TimePoint & operator+=(const Duration &rhs)
Definition: TimePoint.h:34
constexpr TimeCommon operator+(const TimePoint< Clock, Dur > &lhs, const Duration< Rep, Period > &rhs)
operator+(TimePoint, Duration). Returns a time point of best-fit duration.
Definition: TimePoint.h:74
constexpr Duration time() const
Get duration since clock epoch time.
Definition: TimePoint.h:56
constexpr DurCommon operator-(const TimePoint< Clock, Dur > &lhs, const TimePoint< Clock, Dur2 > &rhs)
operator-(TimePoint, TimePoint). Returns a best-fit duration.
Definition: TimePoint.h:95
TimePoint & operator=(const TimePoint< Clock, Dur2 > &rhs)
Definition: TimePoint.h:30
Global Honeycomb namespace.
constexpr bool operator>=(const TimePoint< Clock, Dur2 > &rhs) const
Definition: TimePoint.h:53