* include/std/variant (__accepted_index): Use void_t.
From-SVN: r262471
This commit is contained in:
parent
f9ccb8c0af
commit
4d023b5bd4
2 changed files with 7 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
|||
2018-07-06 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
* include/std/variant (__accepted_index): Use void_t.
|
||||
|
||||
2018-07-05 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
PR libstdc++/85831
|
||||
|
|
|
@ -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<typename _Tp, typename _Variant, typename = void>
|
||||
struct __accepted_index
|
||||
{ static constexpr size_t value = variant_npos; };
|
||||
|
@ -718,8 +719,7 @@ namespace __variant
|
|||
template<typename _Tp, typename... _Types>
|
||||
struct __accepted_index<
|
||||
_Tp, variant<_Types...>,
|
||||
decltype(__overload_set<_Types...>::_S_fun(std::declval<_Tp>()),
|
||||
std::declval<void>())>
|
||||
void_t<decltype(__overload_set<_Types...>::_S_fun(std::declval<_Tp>()))>>
|
||||
{
|
||||
static constexpr size_t value = sizeof...(_Types) - 1
|
||||
- decltype(__overload_set<_Types...>::
|
||||
|
|
Loading…
Add table
Reference in a new issue