// As above, but for difference_type arguments.
template<typename _Tp>
- using _Diff = conditional_t<is_pointer_v<_Tp>, ptrdiff_t, _Val<_Tp>>;
+ using _Diff = __conditional_t<is_pointer_v<_Tp>, ptrdiff_t, _Val<_Tp>>;
template<size_t _Size, size_t _Align>
_GLIBCXX_ALWAYS_INLINE bool
template<typename _Ht>
static constexpr
- typename conditional<std::is_lvalue_reference<_Ht>::value,
- const value_type&, value_type&&>::type
+ __conditional_t<std::is_lvalue_reference<_Ht>::value,
+ const value_type&, value_type&&>
__fwd_value_for(value_type& __val) noexcept
{ return std::move(__val); }
_M_insert_unique(_Kt&&, _Arg&&, const _NodeGenerator&);
template<typename _Kt>
- static typename conditional<
+ static __conditional_t<
__and_<__is_nothrow_invocable<_Hash&, const key_type&>,
__not_<__is_nothrow_invocable<_Hash&, _Kt>>>::value,
- key_type, _Kt&&>::type
+ key_type, _Kt&&>
_S_forward_key(_Kt&& __k)
{ return std::forward<_Kt>(__k); }
{
__alloc_node_gen_t __alloc_gen(*this);
- using _Fwd_Ht = typename
- conditional<__move_if_noexcept_cond<value_type>::value,
- const _Hashtable&, _Hashtable&&>::type;
+ using _Fwd_Ht = __conditional_t<
+ __move_if_noexcept_cond<value_type>::value,
+ const _Hashtable&, _Hashtable&&>;
_M_assign(std::forward<_Fwd_Ht>(__ht), __alloc_gen);
__ht.clear();
}
using __node_type = typename __base_type::__node_type;
public:
- typedef _Value value_type;
- typedef std::ptrdiff_t difference_type;
- typedef std::forward_iterator_tag iterator_category;
+ using value_type = _Value;
+ using difference_type = std::ptrdiff_t;
+ using iterator_category = std::forward_iterator_tag;
- using pointer = typename std::conditional<__constant_iterators,
- const value_type*, value_type*>::type;
+ using pointer = __conditional_t<__constant_iterators,
+ const value_type*, value_type*>;
- using reference = typename std::conditional<__constant_iterators,
- const value_type&, value_type&>::type;
+ using reference = __conditional_t<__constant_iterators,
+ const value_type&, value_type&>;
_Node_iterator() = default;
using iterator = _Node_iterator<_Value, __constant_iterators::value,
__hash_cached::value>;
- using const_iterator = _Node_const_iterator<_Value, __constant_iterators::value,
+ using const_iterator = _Node_const_iterator<_Value,
+ __constant_iterators::value,
__hash_cached::value>;
- using __ireturn_type = typename std::conditional<__unique_keys::value,
- std::pair<iterator, bool>,
- iterator>::type;
+ using __ireturn_type = __conditional_t<__unique_keys::value,
+ std::pair<iterator, bool>,
+ iterator>;
__ireturn_type
insert(const value_type& __v)
using __hash_code_base = typename __base_type::__hash_code_base;
public:
- typedef _Value value_type;
- typedef typename std::conditional<__constant_iterators,
- const value_type*, value_type*>::type
- pointer;
- typedef typename std::conditional<__constant_iterators,
- const value_type&, value_type&>::type
- reference;
- typedef std::ptrdiff_t difference_type;
- typedef std::forward_iterator_tag iterator_category;
+ using value_type = _Value;
+ using pointer = __conditional_t<__constant_iterators,
+ const value_type*, value_type*>;
+ using reference = __conditional_t<__constant_iterators,
+ const value_type&, value_type&>;
+ using difference_type = ptrdiff_t;
+ using iterator_category = forward_iterator_tag;
_Local_iterator() = default;
*/
template<typename _Tp>
_GLIBCXX_NODISCARD
- constexpr typename
- conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
+ constexpr
+ __conditional_t<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>
move_if_noexcept(_Tp& __x) noexcept
{ return std::move(__x); }
template<unsigned long long _Val, typename _IntType, typename... _Ints>
struct _Select_int_base<_Val, _IntType, _Ints...>
- : conditional_t<(_Val <= __gnu_cxx::__int_traits<_IntType>::__max),
- integral_constant<_IntType, (_IntType)_Val>,
- _Select_int_base<_Val, _Ints...>>
+ : __conditional_t<(_Val <= __gnu_cxx::__int_traits<_IntType>::__max),
+ integral_constant<_IntType, (_IntType)_Val>,
+ _Select_int_base<_Val, _Ints...>>
{ };
template<unsigned long long _Val>
template<typename _Tp>
using __make_not_void
- = typename conditional<is_void<_Tp>::value, __undefined, _Tp>::type;
+ = __conditional_t<is_void<_Tp>::value, __undefined, _Tp>;
/**
* @brief Uniform interface to all pointer-like types
requires (_IsMove
? indirectly_movable<_Iter, _Out>
: indirectly_copyable<_Iter, _Out>)
- constexpr conditional_t<_IsMove,
- move_backward_result<_Iter, _Out>,
- copy_backward_result<_Iter, _Out>>
+ constexpr __conditional_t<_IsMove,
+ move_backward_result<_Iter, _Out>,
+ copy_backward_result<_Iter, _Out>>
__copy_or_move_backward(_Iter __first, _Sent __last, _Out __result);
template<bool _IsMove,
requires (_IsMove
? indirectly_movable<_Iter, _Out>
: indirectly_copyable<_Iter, _Out>)
- constexpr conditional_t<_IsMove,
- move_result<_Iter, _Out>,
- copy_result<_Iter, _Out>>
+ constexpr __conditional_t<_IsMove,
+ move_result<_Iter, _Out>,
+ copy_result<_Iter, _Out>>
__copy_or_move(_Iter __first, _Sent __last, _Out __result)
{
// TODO: implement more specializations to be at least on par with
requires (_IsMove
? indirectly_movable<_Iter, _Out>
: indirectly_copyable<_Iter, _Out>)
- constexpr conditional_t<_IsMove,
- move_backward_result<_Iter, _Out>,
- copy_backward_result<_Iter, _Out>>
+ constexpr __conditional_t<_IsMove,
+ move_backward_result<_Iter, _Out>,
+ copy_backward_result<_Iter, _Out>>
__copy_or_move_backward(_Iter __first, _Sent __last, _Out __result)
{
// TODO: implement more specializations to be at least on par with
};
template<range _Range>
- using borrowed_iterator_t = conditional_t<borrowed_range<_Range>,
- iterator_t<_Range>,
- dangling>;
+ using borrowed_iterator_t = __conditional_t<borrowed_range<_Range>,
+ iterator_t<_Range>,
+ dangling>;
} // namespace ranges
_GLIBCXX_END_NAMESPACE_VERSION
enable_borrowed_range<subrange<_It, _Sent, _Kind>> = true;
template<range _Range>
- using borrowed_subrange_t = conditional_t<borrowed_range<_Range>,
- subrange<iterator_t<_Range>>,
- dangling>;
+ using borrowed_subrange_t = __conditional_t<borrowed_range<_Range>,
+ subrange<iterator_t<_Range>>,
+ dangling>;
} // namespace ranges
// The following ranges algorithms are used by <ranges>, and are defined here
private:
// Currently we only use the cache for char
- typedef typename std::is_same<_CharT, char>::type _UseCache;
+ using _UseCache = typename std::is_same<_CharT, char>::type;
static constexpr size_t
_S_cache_size =
1ul << (sizeof(_CharT) * __CHAR_BIT__ * int(_UseCache::value));
struct _Dummy { };
- typedef typename std::conditional<_UseCache::value,
- std::bitset<_S_cache_size>,
- _Dummy>::type _CacheT;
- typedef typename std::make_unsigned<_CharT>::type _UnsignedCharT;
+ using _CacheT = std::__conditional_t<_UseCache::value,
+ std::bitset<_S_cache_size>,
+ _Dummy>;
+ using _UnsignedCharT = typename std::make_unsigned<_CharT>::type;
bool
_M_apply(_CharT __ch, false_type) const;
return;
using _Ptr = typename unique_ptr<_Tp, _Del>::pointer;
- using _Del2 = typename conditional<is_reference<_Del>::value,
+ using _Del2 = __conditional_t<is_reference<_Del>::value,
reference_wrapper<typename remove_reference<_Del>::type>,
- _Del>::type;
+ _Del>;
using _Sp_cd_type
= _Sp_counted_deleter<_Ptr, _Del2, allocator<void>, _Lp>;
using _Alloc = allocator<_Sp_cd_type>;
__copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
#if __cplusplus >= 201103L
- using __assignable = conditional<_IsMove,
- is_move_assignable<_Tp>,
- is_copy_assignable<_Tp>>;
+ using __assignable = __conditional_t<_IsMove,
+ is_move_assignable<_Tp>,
+ is_copy_assignable<_Tp>>;
// trivial types can have deleted assignment
- static_assert( __assignable::type::value, "type must be assignable" );
+ static_assert( __assignable::value, "type must be assignable" );
#endif
const ptrdiff_t _Num = __last - __first;
if (_Num)
__copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
{
#if __cplusplus >= 201103L
- using __assignable = conditional<_IsMove,
- is_move_assignable<_Tp>,
- is_copy_assignable<_Tp>>;
+ using __assignable = __conditional_t<_IsMove,
+ is_move_assignable<_Tp>,
+ is_copy_assignable<_Tp>>;
// trivial types can have deleted assignment
- static_assert( __assignable::type::value, "type must be assignable" );
+ static_assert( __assignable::value, "type must be assignable" );
#endif
const ptrdiff_t _Num = __last - __first;
if (_Num)
// otherwise use _Otherwise.
template<typename _Cat, typename _Limit, typename _Otherwise = _Cat>
using __clamp_iter_cat
- = conditional_t<derived_from<_Cat, _Limit>, _Limit, _Otherwise>;
+ = __conditional_t<derived_from<_Cat, _Limit>, _Limit, _Otherwise>;
}
#endif
typedef typename __traits_type::reference reference;
#else
using iterator_concept
- = conditional_t<random_access_iterator<_Iterator>,
- random_access_iterator_tag,
- bidirectional_iterator_tag>;
+ = __conditional_t<random_access_iterator<_Iterator>,
+ random_access_iterator_tag,
+ bidirectional_iterator_tag>;
using iterator_category
= __detail::__clamp_iter_cat<typename __traits_type::iterator_category,
random_access_iterator_tag>;
typedef _Iterator pointer;
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2106. move_iterator wrapping iterators returning prvalues
- typedef typename conditional<is_reference<__base_ref>::value,
- typename remove_reference<__base_ref>::type&&,
- __base_ref>::type reference;
+ using reference
+ = __conditional_t<is_reference<__base_ref>::value,
+ typename remove_reference<__base_ref>::type&&,
+ __base_ref>;
#endif
_GLIBCXX17_CONSTEXPR
{ return move_iterator<_Iterator>(std::move(__i)); }
template<typename _Iterator, typename _ReturnType
- = typename conditional<__move_if_noexcept_cond
+ = __conditional_t<__move_if_noexcept_cond
<typename iterator_traits<_Iterator>::value_type>::value,
- _Iterator, move_iterator<_Iterator>>::type>
+ _Iterator, move_iterator<_Iterator>>>
inline _GLIBCXX17_CONSTEXPR _ReturnType
__make_move_if_noexcept_iterator(_Iterator __i)
{ return _ReturnType(__i); }
// Overload for pointers that matches std::move_if_noexcept more closely,
// returning a constant iterator when we don't want to move.
template<typename _Tp, typename _ReturnType
- = typename conditional<__move_if_noexcept_cond<_Tp>::value,
- const _Tp*, move_iterator<_Tp*>>::type>
+ = __conditional_t<__move_if_noexcept_cond<_Tp>::value,
+ const _Tp*, move_iterator<_Tp*>>>
inline _GLIBCXX17_CONSTEXPR _ReturnType
__make_move_if_noexcept_iterator(_Tp* __i)
{ return _ReturnType(__i); }
}
public:
- using iterator_concept = conditional_t<forward_iterator<_It>,
- forward_iterator_tag, input_iterator_tag>;
+ using iterator_concept = __conditional_t<forward_iterator<_It>,
+ forward_iterator_tag,
+ input_iterator_tag>;
using iterator_category = decltype(_S_iter_cat());
using value_type = iter_value_t<_It>;
using difference_type = iter_difference_t<_It>;
requires same_as<__detail::__iter_traits<_It>, iterator_traits<_It>>
struct iterator_traits<counted_iterator<_It>> : iterator_traits<_It>
{
- using pointer = conditional_t<contiguous_iterator<_It>,
- add_pointer_t<iter_reference_t<_It>>,
- void>;
+ using pointer = __conditional_t<contiguous_iterator<_It>,
+ add_pointer_t<iter_reference_t<_It>>,
+ void>;
};
#endif // C++20
is_convertible<_U2&&, _T2>>::value;
}
-
template <bool __implicit, typename _U1, typename _U2>
static constexpr bool _DeprConsPair()
{
using __do_converts = __and_<is_convertible<_U1&&, _T1>,
is_convertible<_U2&&, _T2>>;
- using __converts = typename conditional<__implicit,
- __do_converts,
- __not_<__do_converts>>::type;
+ using __converts = __conditional_t<__implicit,
+ __do_converts,
+ __not_<__do_converts>>;
return __and_<is_constructible<_T1, _U1&&>,
is_constructible<_T2, _U2&&>,
__converts
second(std::forward<_U2>(__p.second)) { }
pair&
- operator=(typename conditional<
- __and_<is_copy_assignable<_T1>,
- is_copy_assignable<_T2>>::value,
- const pair&, const __nonesuch&>::type __p)
+ operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
+ is_copy_assignable<_T2>>::value,
+ const pair&, const __nonesuch&> __p)
{
first = __p.first;
second = __p.second;
}
pair&
- operator=(typename conditional<
- __and_<is_move_assignable<_T1>,
- is_move_assignable<_T2>>::value,
- pair&&, __nonesuch&&>::type __p)
+ operator=(__conditional_t<__and_<is_move_assignable<_T1>,
+ is_move_assignable<_T2>>::value,
+ pair&&, __nonesuch&&> __p)
noexcept(__and_<is_nothrow_move_assignable<_T1>,
is_nothrow_move_assignable<_T2>>::value)
{
_M_clone_node(_Link_type __x, _NodeGen& __node_gen)
{
#if __cplusplus >= 201103L
- using _Vp = typename conditional<_MoveValue,
- value_type&&,
- const value_type&>::type;
+ using _Vp = __conditional_t<_MoveValue,
+ value_type&&,
+ const value_type&>;
#endif
_Link_type __tmp
= __node_gen(_GLIBCXX_FORWARD(_Vp, *__x->_M_valptr()));
#if __cplusplus > 201402L
using node_type = _Node_handle<_Key, _Val, _Node_allocator>;
using insert_return_type = _Node_insert_return<
- conditional_t<is_same_v<_Key, _Val>, const_iterator, iterator>,
+ __conditional_t<is_same_v<_Key, _Val>, const_iterator, iterator>,
node_type>;
#endif
*/
template<typename _Up, typename _Ep, typename = _Require<
__safe_conversion_up<_Up, _Ep>,
- typename conditional<is_reference<_Dp>::value,
- is_same<_Ep, _Dp>,
- is_convertible<_Ep, _Dp>>::type>>
+ __conditional_t<is_reference<_Dp>::value,
+ is_same<_Ep, _Dp>,
+ is_convertible<_Ep, _Dp>>>>
unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
: _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter()))
{ }
template<typename _Up, typename _Ep, typename = _Require<
__safe_conversion_up<_Up, _Ep>,
- typename conditional<is_reference<_Dp>::value,
- is_same<_Ep, _Dp>,
- is_convertible<_Ep, _Dp>>::type>>
+ __conditional_t<is_reference<_Dp>::value,
+ is_same<_Ep, _Dp>,
+ is_convertible<_Ep, _Dp>>>>
unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
: _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter()))
{ }
template<typename _Tp, typename _Alloc, typename... _Args>
struct __uses_alloc<true, _Tp, _Alloc, _Args...>
- : conditional<
+ : __conditional_t<
is_constructible<_Tp, allocator_arg_t, const _Alloc&, _Args...>::value,
__uses_alloc1<_Alloc>,
- __uses_alloc2<_Alloc>>::type
+ __uses_alloc2<_Alloc>>
{
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 2586. Wrong value category used in scoped_allocator_adaptor::construct
template<template<typename...> class _Predicate,
typename _Tp, typename _Alloc, typename... _Args>
struct __is_uses_allocator_predicate
- : conditional<uses_allocator<_Tp, _Alloc>::value,
+ : __conditional_t<uses_allocator<_Tp, _Alloc>::value,
__or_<_Predicate<_Tp, allocator_arg_t, _Alloc, _Args...>,
_Predicate<_Tp, _Args..., _Alloc>>,
- _Predicate<_Tp, _Args...>>::type { };
+ _Predicate<_Tp, _Args...>> { };
template<typename _Tp, typename _Alloc, typename... _Args>
struct __is_uses_allocator_constructible
#if __cplusplus >= 201103L
# include <bits/stl_iterator.h> // for __miter_base
-# include <type_traits> // for is_lvalue_reference and conditional.
+# include <type_traits> // for is_lvalue_reference and __conditional_t.
#endif
#include <debug/helper_functions.h>
using __lvalref = std::is_lvalue_reference<
typename std::iterator_traits<_InputIterator>::reference>;
using __contiguous = _Is_contiguous_sequence<_Sequence>;
- using __tag = typename std::conditional<__lvalref::value, __contiguous,
- std::__false_type>::type;
+ using __tag = std::__conditional_t<__lvalref::value, __contiguous,
+ std::__false_type>;
#endif
return __foreign_iterator_aux3(__it, __other, __other_end, __tag());
}
struct _Manager_external; // creates contained object on the heap
template<typename _Tp>
- using _Manager = conditional_t<_Internal<_Tp>::value,
- _Manager_internal<_Tp>,
- _Manager_external<_Tp>>;
+ using _Manager = __conditional_t<_Internal<_Tp>::value,
+ _Manager_internal<_Tp>,
+ _Manager_external<_Tp>>;
template<typename _Tp, typename _Decayed = decay_t<_Tp>>
using _Decay = enable_if_t<!is_same<_Decayed, any>::value, _Decayed>;
// If the type _Tp could never be stored in an any we don't want to
// instantiate _Manager<_Tp>, so use _Manager<any::_Op> instead, which
// is explicitly specialized and has a no-op _S_manage function.
- using _Vp = conditional_t<__and_<__does_not_decay, __is_copyable>::value,
- _Up, any::_Op>;
+ using _Vp = __conditional_t<__and_<__does_not_decay, __is_copyable>{},
+ _Up, any::_Op>;
// First try comparing function addresses, which works without RTTI
if (__any->_M_manager == &any::_Manager<_Vp>::_S_manage
#if __cpp_rtti
= typename __result_type::completion_handler_type;
private:
- using __handler_type = conditional_t<
+ using __handler_type = __conditional_t<
is_same<_CompletionToken, completion_handler_type>::value,
completion_handler_type&,
completion_handler_type>;
typename _Val = typename iterator_traits<_RAIter>::value_type,
typename _Diff = typename iterator_traits<_RAIter>::difference_type>
using __boyer_moore_base_t
- = std::conditional_t<std::__is_byte_like<_Val, _Pred>::value,
- __boyer_moore_array_base<_Diff, 256, _Pred>,
- __boyer_moore_map_base<_Val, _Diff, _Hash, _Pred>>;
+ = std::__conditional_t<std::__is_byte_like<_Val, _Pred>::value,
+ __boyer_moore_array_base<_Diff, 256, _Pred>,
+ __boyer_moore_map_base<_Val, _Diff, _Hash, _Pred>>;
template<typename _RAIter, typename _Hash
= std::hash<typename std::iterator_traits<_RAIter>::value_type>,
struct _Manager_external; // creates contained object on the heap
template<typename _Tp>
- using _Manager = conditional_t<_Internal<_Tp>::value,
- _Manager_internal<_Tp>,
- _Manager_external<_Tp>>;
+ using _Manager = __conditional_t<_Internal<_Tp>::value,
+ _Manager_internal<_Tp>,
+ _Manager_external<_Tp>>;
template<typename _Tp, typename _VTp = decay_t<_Tp>>
using _Decay_if_not_any = enable_if_t<!is_same_v<_VTp, any>, _VTp>;
typename _Val = typename iterator_traits<_RAIter>::value_type,
typename _Diff = typename iterator_traits<_RAIter>::difference_type>
using __boyer_moore_base_t
- = conditional_t<__is_byte_like<_Val, _Pred>::value,
- __boyer_moore_array_base<_Diff, 256, _Pred>,
- __boyer_moore_map_base<_Val, _Diff, _Hash, _Pred>>;
+ = __conditional_t<__is_byte_like<_Val, _Pred>::value,
+ __boyer_moore_array_base<_Diff, 256, _Pred>,
+ __boyer_moore_map_base<_Val, _Diff, _Hash, _Pred>>;
template<typename _RAIter, typename _Hash
= hash<typename iterator_traits<_RAIter>::value_type>,
// Data members using this alias should use [[no_unique_address]] so that
// they take no space when not needed.
template<bool _Present, typename _Tp>
- using __maybe_present_t = conditional_t<_Present, _Tp, _Empty>;
+ using __maybe_present_t = __conditional_t<_Present, _Tp, _Empty>;
// Alias for a type that is conditionally const.
template<bool _Const, typename _Tp>
- using __maybe_const_t = conditional_t<_Const, const _Tp, _Tp>;
+ using __maybe_const_t = __conditional_t<_Const, const _Tp, _Tp>;
} // namespace __detail
bool _M_trailing_empty = false;
public:
- using iterator_concept = conditional_t<forward_range<_Base>,
- forward_iterator_tag,
- input_iterator_tag>;
+ using iterator_concept = __conditional_t<forward_range<_Base>,
+ forward_iterator_tag,
+ input_iterator_tag>;
// iterator_category defined in __lazy_split_view_outer_iter_cat
using difference_type = range_difference_t<_Base>;
// Use the Empty Base-class Optimization for empty, non-final types.
template<typename _Tp>
using __empty_not_final
- = typename conditional<__is_final(_Tp), false_type,
- __is_empty_non_tuple<_Tp>>::type;
+ = __conditional_t<__is_final(_Tp), false_type,
+ __is_empty_non_tuple<_Tp>>;
template<size_t _Idx, typename _Head,
bool = __empty_not_final<_Head>::value>
_GLIBCXX20_CONSTEXPR
tuple&
- operator=(typename conditional<__assignable<const _Elements&...>(),
- const tuple&,
- const __nonesuch&>::type __in)
+ operator=(__conditional_t<__assignable<const _Elements&...>(),
+ const tuple&,
+ const __nonesuch&> __in)
noexcept(__nothrow_assignable<const _Elements&...>())
{
this->_M_assign(__in);
_GLIBCXX20_CONSTEXPR
tuple&
- operator=(typename conditional<__assignable<_Elements...>(),
- tuple&&,
- __nonesuch&&>::type __in)
+ operator=(__conditional_t<__assignable<_Elements...>(),
+ tuple&&,
+ __nonesuch&&> __in)
noexcept(__nothrow_assignable<_Elements...>())
{
this->_M_assign(std::move(__in));
_GLIBCXX20_CONSTEXPR
tuple&
- operator=(typename conditional<__assignable<const _T1&, const _T2&>(),
- const tuple&,
- const __nonesuch&>::type __in)
+ operator=(__conditional_t<__assignable<const _T1&, const _T2&>(),
+ const tuple&,
+ const __nonesuch&> __in)
noexcept(__nothrow_assignable<const _T1&, const _T2&>())
{
this->_M_assign(__in);
_GLIBCXX20_CONSTEXPR
tuple&
- operator=(typename conditional<__assignable<_T1, _T2>(),
- tuple&&,
- __nonesuch&&>::type __in)
+ operator=(__conditional_t<__assignable<_T1, _T2>(),
+ tuple&&,
+ __nonesuch&&> __in)
noexcept(__nothrow_assignable<_T1, _T2>())
{
this->_M_assign(std::move(__in));
// Metaprogramming helper types.
- template<bool, typename, typename>
- struct conditional;
+ template<bool>
+ struct __conditional
+ {
+ template<typename _Tp, typename>
+ using type = _Tp;
+ };
+
+ template<>
+ struct __conditional<false>
+ {
+ template<typename, typename _Up>
+ using type = _Up;
+ };
+
+ // More efficient version of std::conditional_t for internal use (and C++11)
+ template<bool _Cond, typename _If, typename _Else>
+ using __conditional_t
+ = typename __conditional<_Cond>::template type<_If, _Else>;
/// @cond undocumented
template <typename _Type>
template<typename _B1, typename _B2>
struct __or_<_B1, _B2>
- : public conditional<_B1::value, _B1, _B2>::type
+ : public __conditional_t<_B1::value, _B1, _B2>
{ };
template<typename _B1, typename _B2, typename _B3, typename... _Bn>
struct __or_<_B1, _B2, _B3, _Bn...>
- : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
+ : public __conditional_t<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>
{ };
template<typename...>
template<typename _B1, typename _B2>
struct __and_<_B1, _B2>
- : public conditional<_B1::value, _B2, _B1>::type
+ : public __conditional_t<_B1::value, _B2, _B1>
{ };
template<typename _B1, typename _B2, typename _B3, typename... _Bn>
struct __and_<_B1, _B2, _B3, _Bn...>
- : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
+ : public __conditional_t<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>
{ };
template<typename _Pp>
{
typedef __remove_cvref_t<_Arg> _Argval;
typedef _Res _Class::* _MemPtr;
- typedef typename conditional<__or_<is_same<_Argval, _Class>,
+ typedef typename __conditional_t<__or_<is_same<_Argval, _Class>,
is_base_of<_Class, _Argval>>::value,
__result_of_memobj_ref<_MemPtr, _Arg>,
__result_of_memobj_deref<_MemPtr, _Arg>
- >::type::type type;
+ >::type type;
};
template<typename _MemPtr, typename _Arg, typename... _Args>
{
typedef typename remove_reference<_Arg>::type _Argval;
typedef _Res _Class::* _MemPtr;
- typedef typename conditional<is_base_of<_Class, _Argval>::value,
+ typedef typename __conditional_t<is_base_of<_Class, _Argval>::value,
__result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
__result_of_memfun_deref<_MemPtr, _Arg, _Args...>
- >::type::type type;
+ >::type type;
};
// _GLIBCXX_RESOLVE_LIB_DEFECTS
typename _AsV = decltype(__variant::__as(std::declval<_Variant>())),
typename _Tp = variant_alternative_t<_Np, remove_reference_t<_AsV>>>
using __get_t
- = conditional_t<is_lvalue_reference_v<_Variant>, _Tp&, _Tp&&>;
+ = __conditional_t<is_lvalue_reference_v<_Variant>, _Tp&, _Tp&&>;
// Return type of std::visit.
template<typename _Visitor, typename... _Variants>