diff --git a/test/testit b/test/testit index fb9011b..4feb9ba 100755 --- a/test/testit +++ b/test/testit @@ -48,7 +48,7 @@ if [ -z "$CXX_LANG" ] then CXX_LANG=c++14 fi -OPTIONS="-std=${CXX_LANG} $OPTIONS -I$ROOT -Wall" +OPTIONS="-std=${CXX_LANG} $OPTIONS -I$ROOT -Wall $ROOT/tz.cpp -lcurl" case $TRIPLE in *-*-mingw* | *-*-cygwin* | *-*-win*) diff --git a/tz.h b/tz.h index ec80235..256676a 100644 --- a/tz.h +++ b/tz.h @@ -87,6 +87,14 @@ static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true, # define MISSING_LEAP_SECONDS 0 #endif +#ifndef HAS_DEDUCTION_GUIDES +# if __cplusplus >= 201703 +# define HAS_DEDUCTION_GUIDES 1 +# else +# define HAS_DEDUCTION_GUIDES 0 +# endif +#endif // HAS_DEDUCTION_GUIDES + #include "date.h" #if defined(_MSC_VER) && (_MSC_VER < 1900) @@ -319,7 +327,7 @@ public: zoned_time& operator=(const sys_time& st); zoned_time& operator=(const local_time& ut); - operator sys_time() const; + explicit operator sys_time() const; explicit operator local_time() const; const time_zone* get_time_zone() const; @@ -343,6 +351,26 @@ private: using zoned_seconds = zoned_time; +#if HAS_DEDUCTION_GUIDES + +template +zoned_time(sys_time) + -> zoned_time>; + +template +zoned_time(Zone, sys_time) + -> zoned_time>; + +template +zoned_time(Zone, local_time, choose = choose::earliest) + -> zoned_time>; + +template +zoned_time(Zone, zoned_time, choose = choose::earliest) + -> zoned_time>; + +#endif // HAS_DEDUCTION_GUIDES + template inline bool