From: Casey Bodley Date: Tue, 2 Oct 2018 19:31:09 +0000 (-0400) Subject: include: add utime_t ctor for ceph::coarse_real_time X-Git-Tag: v12.2.9~29^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F24318%2Fhead;p=ceph.git include: add utime_t ctor for ceph::coarse_real_time this change differs from the upstream commit 61fb24883e812c11016acea0654f6aef7ddab1f7 because it relied on the std::void_t template, which isn't available in c++11. just add another explicit constructor for coarse_real_time as a workaround Signed-off-by: Casey Bodley --- diff --git a/src/include/utime.h b/src/include/utime.h index 732eaebcdff0..ba4f17e95826 100644 --- a/src/include/utime.h +++ b/src/include/utime.h @@ -67,6 +67,10 @@ public: ceph_timespec ts = real_clock::to_ceph_timespec(rt); decode_timeval(&ts); } + explicit utime_t(const ceph::coarse_real_time& crt) { + ceph_timespec ts = coarse_real_clock::to_ceph_timespec(crt); + decode_timeval(&ts); + } utime_t(const struct timeval &v) { set_from_timeval(&v); }