From 7c020642fb1f1bff33a10764eeab057ea7af9aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kami=C5=84ski?= Date: Tue, 6 Aug 2019 08:32:09 +0200 Subject: [PATCH] Fixed deduction guides for GCC 8. The GCC 8 was correctly preffering the deduction guide syntezied from the std::string_view constructor which is more specialized than deduction guide. Changed the constructor so the Duration cannot be deduced from it. --- include/date/tz.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/include/date/tz.h b/include/date/tz.h index bc442e6..b011696 100644 --- a/include/date/tz.h +++ b/include/date/tz.h @@ -151,6 +151,15 @@ enum class choose {earliest, latest}; namespace detail { struct undocumented; + + template + struct nodeduct + { + using type = T; + }; + + template + using nodeduct_t = typename nodeduct::type; } struct sys_info @@ -447,7 +456,7 @@ public: sys_time >::value >::type> - zoned_time(std::string_view name, const sys_time& st); + zoned_time(std::string_view name, detail::nodeduct_t&> st); template >::value >::type> - zoned_time(std::string_view name, const local_time& tp); + zoned_time(std::string_view name, detail::nodeduct_t&> tp); template ::value >::type> - zoned_time(std::string_view name, const local_time& tp, choose c); + zoned_time(std::string_view name, detail::nodeduct_t&> tp, choose c); template template inline zoned_time::zoned_time(std::string_view name, - const sys_time& st) + detail::nodeduct_t&> st) : zoned_time(zoned_traits::locate_zone(name), st) {} @@ -1456,7 +1465,7 @@ template template inline zoned_time::zoned_time(std::string_view name, - const local_time& t) + detail::nodeduct_t&> t) : zoned_time(zoned_traits::locate_zone(name), t) {} @@ -1464,7 +1473,7 @@ template template inline zoned_time::zoned_time(std::string_view name, - const local_time& t, choose c) + detail::nodeduct_t&> t, choose c) : zoned_time(zoned_traits::locate_zone(name), t, c) {}