From 4e2a7ac05bbd0aa48e7edab682163eb40f0e1aa0 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 5 May 2016 22:41:26 -0400 Subject: [PATCH] zoned_time with durations coarser than seconds are too error prone. --- tz.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tz.h b/tz.h index 1ff0aa5..b28f2bd 100644 --- a/tz.h +++ b/tz.h @@ -296,8 +296,8 @@ public: private: static_assert(std::ratio_less_equal::value, - "zoned_time must have a precision of hours or finer"); + std::chrono::seconds::period>::value, + "zoned_time must have a precision of seconds or finer"); }; using zoned_seconds = zoned_time; @@ -914,15 +914,15 @@ zoned_time::get_sys_time() const template inline -zoned_time +zoned_time::type> make_zoned(sys_time tp) { - return zoned_time{tp}; + return {tp}; } template inline -zoned_time +zoned_time::type> make_zoned(const time_zone* zone, local_time tp) { return {zone, tp}; @@ -930,7 +930,7 @@ make_zoned(const time_zone* zone, local_time tp) template inline -zoned_time +zoned_time::type> make_zoned(const std::string& name, local_time tp) { return {name, tp}; @@ -938,7 +938,7 @@ make_zoned(const std::string& name, local_time tp) template inline -zoned_time +zoned_time::type> make_zoned(const time_zone* zone, const zoned_time& zt) { return {zone, zt}; @@ -946,7 +946,7 @@ make_zoned(const time_zone* zone, const zoned_time& zt) template inline -zoned_time +zoned_time::type> make_zoned(const std::string& name, const zoned_time& zt) { return {name, zt}; @@ -954,7 +954,7 @@ make_zoned(const std::string& name, const zoned_time& zt) template inline -zoned_time +zoned_time::type> make_zoned(const time_zone* zone, const zoned_time& zt, choose c) { return {zone, zt, c}; @@ -962,7 +962,7 @@ make_zoned(const time_zone* zone, const zoned_time& zt, choose c) template inline -zoned_time +zoned_time::type> make_zoned(const std::string& name, const zoned_time& zt, choose c) { return {name, zt, c}; @@ -970,7 +970,7 @@ make_zoned(const std::string& name, const zoned_time& zt, choose c) template inline -zoned_time +zoned_time::type> make_zoned(const time_zone* zone, const sys_time& st) { return {zone, st}; @@ -978,7 +978,7 @@ make_zoned(const time_zone* zone, const sys_time& st) template inline -zoned_time +zoned_time::type> make_zoned(const std::string& name, const sys_time& st) { return {name, st};