From 4d023b5bd4553cc3a6da19289563430480cc303d Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 6 Jul 2018 11:20:38 +0100 Subject: [PATCH] * include/std/variant (__accepted_index): Use void_t. From-SVN: r262471 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/include/std/variant | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index f78d3043858..30fe76958f0 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,7 @@ +2018-07-06 Jonathan Wakely + + * include/std/variant (__accepted_index): Use void_t. + 2018-07-05 Jonathan Wakely PR libstdc++/85831 diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index 63eafdd58e5..66d878142a4 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -710,7 +710,8 @@ namespace __variant }; // Helper for variant(_Tp&&) and variant::operator=(_Tp&&). - // __accepted_index maps the arbitrary _Tp to an alternative type in _Variant. + // __accepted_index maps an arbitrary _Tp to an alternative type in _Variant + // (or to variant_npos). template struct __accepted_index { static constexpr size_t value = variant_npos; }; @@ -718,8 +719,7 @@ namespace __variant template struct __accepted_index< _Tp, variant<_Types...>, - decltype(__overload_set<_Types...>::_S_fun(std::declval<_Tp>()), - std::declval())> + void_t::_S_fun(std::declval<_Tp>()))>> { static constexpr size_t value = sizeof...(_Types) - 1 - decltype(__overload_set<_Types...>:: -- 2.30.2