Here are some edits... done tjgolubi
public:
typedef TimePoint time_point;
typedef typename time_point::duration duration;
typedef typename time_point::clock clock;
typedef Period period;
...
static time_point Now()
{ return std0x::chrono::time_point_cast<duration(clock::now()); }
static duration Mode(duration x) {
static const duration Epoch = std0x::chrono::duration<int, period>(1);
x %= Epoch;
if (x < duration::zero())
x += Epoch;
return x;
}
public:
PartialTimePoint() noexcept : _partial() { }
Add `noexcept` throughout.
time_point time() conext noexcept { return time(Now()); }
...
friend bool operator==(const PartialTimePoint& lhs,
const PartialTimePoint& rhs)
{ return (lhs.partial() == rhs.partial()); }
friend bool operator!=(const PartialTimePoint& lhs,
const PartialTimePoint& rhs)
{ return (lhs.partial() != rhs.partial()); }