Commit e068ded8 authored by Dominik Charousset's avatar Dominik Charousset

Allow serialization of any std::chrono time point

parent c5999142
...@@ -442,8 +442,8 @@ public: ...@@ -442,8 +442,8 @@ public:
return convert_apply(dref(), x, tmp, assign); return convert_apply(dref(), x, tmp, assign);
} }
template <class Duration> template <class Clock, class Duration>
error apply(std::chrono::time_point<std::chrono::system_clock, Duration>& t) { error apply(std::chrono::time_point<Clock, Duration>& t) {
if (Derived::reads_state) { if (Derived::reads_state) {
auto dur = t.time_since_epoch(); auto dur = t.time_since_epoch();
return apply(dur); return apply(dur);
...@@ -451,7 +451,7 @@ public: ...@@ -451,7 +451,7 @@ public:
if (Derived::writes_state) { if (Derived::writes_state) {
Duration dur{}; Duration dur{};
auto e = apply(dur); auto e = apply(dur);
t = std::chrono::time_point<std::chrono::system_clock, Duration>{dur}; t = std::chrono::time_point<Clock, Duration>{dur};
return e; return e;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment