From 2b1fb36517cca56e160304a60978c8ef007d6076 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 2 Oct 2018 15:31:09 -0400 Subject: [PATCH] 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 --- src/include/utime.h | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.47.3