From 38c24b40909a5e175dc1920c626e06fd2e58633e Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 18 Aug 2017 22:55:31 -0400 Subject: [PATCH] Add fixes for VS-2017. --- tz.h | 85 ++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 16 deletions(-) diff --git a/tz.h b/tz.h index f2943d7..e02e45d 100644 --- a/tz.h +++ b/tz.h @@ -359,11 +359,16 @@ private: sys_time tp_; public: +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::default_zone())> +#endif zoned_time(); + +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::default_zone())> +#endif zoned_time(const sys_time& st); explicit zoned_time(TimeZonePtr z); @@ -379,6 +384,7 @@ public: >::type> explicit zoned_time(std::string_view name); #else +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::locate_zone(std::string())) >::value >::type> +#endif explicit zoned_time(const std::string& name); #endif @@ -493,6 +500,7 @@ public: #else // !HAS_STRING_VIEW +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template >::value >::type> +#endif zoned_time(const std::string& name, const sys_time& st); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template >::value >::type> +#endif zoned_time(const char* name, const sys_time& st); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template >::value >::type> +#endif zoned_time(const std::string& name, const local_time& tp); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template >::value >::type> +#endif zoned_time(const char* name, const local_time& tp); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::value >::type> +#endif zoned_time(const std::string& name, const local_time& tp, choose c); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::value >::type> +#endif zoned_time(const char* name, const local_time& tp, choose c); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::value >::type> +#endif zoned_time(const std::string& name, const zoned_time& zt); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::value >::type> +#endif zoned_time(const char* name, const zoned_time& zt); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::value >::type> +#endif zoned_time(const std::string& name, const zoned_time& zt, choose); +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template ::value >::type> +#endif zoned_time(const char* name, const zoned_time& zt, choose); #endif // !HAS_STRING_VIEW @@ -1314,14 +1341,18 @@ to_raw_pointer(Pointer p) noexcept } // namespace detail template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time() : zone_(zoned_traits::default_zone()) {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const sys_time& st) : zone_(zoned_traits::default_zone()) @@ -1346,7 +1377,9 @@ zoned_time::zoned_time(std::string_view name) #else // !HAS_STRING_VIEW template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const std::string& name) : zoned_time(zoned_traits::locate_zone(name)) @@ -1445,7 +1478,9 @@ zoned_time::zoned_time(std::string_view name, #else // !HAS_STRING_VIEW template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const std::string& name, const sys_time& st) @@ -1453,7 +1488,9 @@ zoned_time::zoned_time(const std::string& name, {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const char* name, const sys_time& st) @@ -1461,7 +1498,9 @@ zoned_time::zoned_time(const char* name, {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const std::string& name, const local_time& t) @@ -1469,7 +1508,9 @@ zoned_time::zoned_time(const std::string& name, {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const char* name, const local_time& t) @@ -1477,7 +1518,9 @@ zoned_time::zoned_time(const char* name, {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const std::string& name, const local_time& t, choose c) @@ -1485,7 +1528,9 @@ zoned_time::zoned_time(const std::string& name, {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const char* name, const local_time& t, choose c) @@ -1493,7 +1538,9 @@ zoned_time::zoned_time(const char* name, {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const std::string& name, const zoned_time& zt) @@ -1501,14 +1548,18 @@ zoned_time::zoned_time(const std::string& name, {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const char* name, const zoned_time& zt) : zoned_time(zoned_traits::locate_zone(name), zt) {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const std::string& name, const zoned_time& zt, choose c) @@ -1516,7 +1567,9 @@ zoned_time::zoned_time(const std::string& name, {} template +#if !defined(_MSC_VER) || (_MSC_VER > 1911) template +#endif inline zoned_time::zoned_time(const char* name, const zoned_time& zt, choose c) @@ -1545,14 +1598,14 @@ zoned_time::operator=(const local_time& ut) template inline -zoned_time::operator local_time() const +zoned_time::operator local_time::duration>() const { return get_local_time(); } template inline -zoned_time::operator sys_time() const +zoned_time::operator sys_time::duration>() const { return get_sys_time(); } @@ -1595,7 +1648,7 @@ inline zoned_time make_zoned() { - return {}; + return zoned_time(); } template @@ -1603,7 +1656,7 @@ inline zoned_time::type> make_zoned(const sys_time& tp) { - return {tp}; + return (tp); } template make_zoned(TimeZonePtr z) { - return zoned_time{std::move(z)}; + return zoned_time(std::move(z)); } inline zoned_seconds make_zoned(const std::string& name) { - return zoned_seconds{name}; + return zoned_seconds(name); } template ::type, TimeZonePtr> make_zoned(TimeZonePtr zone, const local_time& tp) { - return {std::move(zone), tp}; + return (std::move(zone), tp); } template ::type, TimeZonePtr> make_zoned(TimeZonePtr zone, const local_time& tp, choose c) { - return {std::move(zone), tp, c}; + return (std::move(zone), tp, c); } template @@ -1663,7 +1716,7 @@ inline zoned_time::type> make_zoned(const std::string& name, const local_time& tp) { - return {name, tp}; + return (name, tp); } template @@ -1671,7 +1724,7 @@ inline zoned_time::type> make_zoned(const std::string& name, const local_time& tp, choose c) { - return {name, tp, c}; + return (name, tp, c); } template @@ -1679,7 +1732,7 @@ inline zoned_time make_zoned(TimeZonePtr zone, const zoned_time& zt) { - return {std::move(zone), zt}; + return (std::move(zone), zt); } template @@ -1687,7 +1740,7 @@ inline zoned_time make_zoned(const std::string& name, const zoned_time& zt) { - return {name, zt}; + return (name, zt); } template @@ -1695,7 +1748,7 @@ inline zoned_time make_zoned(TimeZonePtr zone, const zoned_time& zt, choose c) { - return {std::move(zone), zt, c}; + return (std::move(zone), zt, c); } template @@ -1703,7 +1756,7 @@ inline zoned_time make_zoned(const std::string& name, const zoned_time& zt, choose c) { - return {name, zt, c}; + return (name, zt, c); } template ::type, TimeZonePtr> make_zoned(TimeZonePtr zone, const sys_time& st) { - return {std::move(zone), st}; + return (std::move(zone), st); } template @@ -1724,7 +1777,7 @@ inline zoned_time::type> make_zoned(const std::string& name, const sys_time& st) { - return {name, st}; + return (name, st); } template