template<typename...>
class tuple;
- template<std::size_t...>
+ template<size_t...>
struct _Index_tuple;
// Concept utility functions, reused in conditionally-explicit
}
private:
- template<typename... _Args1, std::size_t... _Indexes1,
- typename... _Args2, std::size_t... _Indexes2>
+ template<typename... _Args1, size_t... _Indexes1,
+ typename... _Args2, size_t... _Indexes2>
_GLIBCXX20_CONSTEXPR
pair(tuple<_Args1...>&, tuple<_Args2...>&,
- _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
+ _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
#endif // C++11
};
= typename conditional<__is_final(_Tp), false_type,
__is_empty_non_tuple<_Tp>>::type;
- template<std::size_t _Idx, typename _Head,
+ template<size_t _Idx, typename _Head,
bool = __empty_not_final<_Head>::value>
struct _Head_base;
- template<std::size_t _Idx, typename _Head>
+ template<size_t _Idx, typename _Head>
struct _Head_base<_Idx, _Head, true>
: public _Head
{
_M_head(const _Head_base& __b) noexcept { return __b; }
};
- template<std::size_t _Idx, typename _Head>
+ template<size_t _Idx, typename _Head>
struct _Head_base<_Idx, _Head, false>
{
constexpr _Head_base()
* point in the hierarchy; we use it to implement a constant-time
* get() operation.
*/
- template<std::size_t _Idx, typename... _Elements>
+ template<size_t _Idx, typename... _Elements>
struct _Tuple_impl;
/**
* and derive from a @c Tuple_impl containing the remaining elements
* (which contains the @c Tail).
*/
- template<std::size_t _Idx, typename _Head, typename... _Tail>
+ template<size_t _Idx, typename _Head, typename... _Tail>
struct _Tuple_impl<_Idx, _Head, _Tail...>
: public _Tuple_impl<_Idx + 1, _Tail...>,
private _Head_base<_Idx, _Head>
{
- template<std::size_t, typename...> friend class _Tuple_impl;
+ template<size_t, typename...> friend class _Tuple_impl;
typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
typedef _Head_base<_Idx, _Head> _Base;
};
// Basis case of inheritance recursion.
- template<std::size_t _Idx, typename _Head>
+ template<size_t _Idx, typename _Head>
struct _Tuple_impl<_Idx, _Head>
: private _Head_base<_Idx, _Head>
{
- template<std::size_t, typename...> friend class _Tuple_impl;
+ template<size_t, typename...> friend class _Tuple_impl;
typedef _Head_base<_Idx, _Head> _Base;
/// class tuple_size
template<typename... _Elements>
struct tuple_size<tuple<_Elements...>>
- : public integral_constant<std::size_t, sizeof...(_Elements)> { };
+ : public integral_constant<size_t, sizeof...(_Elements)> { };
#if __cplusplus > 201402L
template <typename _Tp>
* Recursive case for tuple_element: strip off the first element in
* the tuple and retrieve the (i-1)th element of the remaining tuple.
*/
- template<std::size_t __i, typename _Head, typename... _Tail>
+ template<size_t __i, typename _Head, typename... _Tail>
struct tuple_element<__i, tuple<_Head, _Tail...> >
: tuple_element<__i - 1, tuple<_Tail...> > { };
"tuple index is in range");
};
- template<std::size_t __i, typename _Head, typename... _Tail>
+ template<size_t __i, typename _Head, typename... _Tail>
constexpr _Head&
__get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept
{ return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); }
- template<std::size_t __i, typename _Head, typename... _Tail>
+ template<size_t __i, typename _Head, typename... _Tail>
constexpr const _Head&
__get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t) noexcept
{ return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); }
/// Return a reference to the ith element of a tuple.
- template<std::size_t __i, typename... _Elements>
+ template<size_t __i, typename... _Elements>
constexpr __tuple_element_t<__i, tuple<_Elements...>>&
get(tuple<_Elements...>& __t) noexcept
{ return std::__get_helper<__i>(__t); }
/// Return a const reference to the ith element of a const tuple.
- template<std::size_t __i, typename... _Elements>
+ template<size_t __i, typename... _Elements>
constexpr const __tuple_element_t<__i, tuple<_Elements...>>&
get(const tuple<_Elements...>& __t) noexcept
{ return std::__get_helper<__i>(__t); }
/// Return an rvalue reference to the ith element of a tuple rvalue.
- template<std::size_t __i, typename... _Elements>
+ template<size_t __i, typename... _Elements>
constexpr __tuple_element_t<__i, tuple<_Elements...>>&&
get(tuple<_Elements...>&& __t) noexcept
{
}
/// Return a const rvalue reference to the ith element of a const tuple rvalue.
- template<std::size_t __i, typename... _Elements>
+ template<size_t __i, typename... _Elements>
constexpr const __tuple_element_t<__i, tuple<_Elements...>>&&
get(const tuple<_Elements...>&& __t) noexcept
{
_Tuple, _Nm>
{ };
- template<std::size_t _Nm, typename _Tuple, typename... _Tp>
+ template<size_t _Nm, typename _Tuple, typename... _Tp>
struct __make_tuple_impl<_Nm, tuple<_Tp...>, _Tuple, _Nm>
{
typedef tuple<_Tp...> __type;
template<typename _Tuple>
struct __do_make_tuple
- : __make_tuple_impl<0, tuple<>, _Tuple, std::tuple_size<_Tuple>::value>
+ : __make_tuple_impl<0, tuple<>, _Tuple, tuple_size<_Tuple>::value>
{ };
// Returns the std::tuple equivalent of a tuple-like type.
template<>
struct __make_1st_indices<>
{
- typedef std::_Index_tuple<> __type;
+ typedef _Index_tuple<> __type;
};
template<typename _Tp, typename... _Tpls>
struct __make_1st_indices<_Tp, _Tpls...>
{
- typedef typename std::_Build_index_tuple<std::tuple_size<
- typename std::remove_reference<_Tp>::type>::value>::__type __type;
+ typedef typename _Build_index_tuple<tuple_size<
+ typename remove_reference<_Tp>::type>::value>::__type __type;
};
// Performs the actual concatenation by step-wise expanding tuple-like
template<typename _Ret, typename _Indices, typename... _Tpls>
struct __tuple_concater;
- template<typename _Ret, std::size_t... _Is, typename _Tp, typename... _Tpls>
- struct __tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...>
+ template<typename _Ret, size_t... _Is, typename _Tp, typename... _Tpls>
+ struct __tuple_concater<_Ret, _Index_tuple<_Is...>, _Tp, _Tpls...>
{
template<typename... _Us>
static constexpr _Ret
};
template<typename _Ret>
- struct __tuple_concater<_Ret, std::_Index_tuple<>>
+ struct __tuple_concater<_Ret, _Index_tuple<>>
{
template<typename... _Us>
static constexpr _Ret
{ }
template<class _T1, class _T2>
- template<typename... _Args1, std::size_t... _Indexes1,
- typename... _Args2, std::size_t... _Indexes2>
+ template<typename... _Args1, size_t... _Indexes1,
+ typename... _Args2, size_t... _Indexes2>
_GLIBCXX20_CONSTEXPR inline
pair<_T1, _T2>::
pair(tuple<_Args1...>& __tuple1, tuple<_Args2...>& __tuple2,
_Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>)
: first(std::forward<_Args1>(std::get<_Indexes1>(__tuple1))...),
- second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...)
+ second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...)
{ }
#if __cplusplus >= 201703L
: public tuple_size<_Tp> { };
/// Gives the type of the ith element of a given tuple type.
- template<std::size_t __i, typename _Tp>
+ template<size_t __i, typename _Tp>
struct tuple_element;
// Duplicate of C++14's tuple_element_t for internal use in C++11 mode
- template<std::size_t __i, typename _Tp>
+ template<size_t __i, typename _Tp>
using __tuple_element_t = typename tuple_element<__i, _Tp>::type;
- template<std::size_t __i, typename _Tp>
+ template<size_t __i, typename _Tp>
struct tuple_element<__i, const _Tp>
{
typedef typename add_const<__tuple_element_t<__i, _Tp>>::type type;
};
- template<std::size_t __i, typename _Tp>
+ template<size_t __i, typename _Tp>
struct tuple_element<__i, volatile _Tp>
{
typedef typename add_volatile<__tuple_element_t<__i, _Tp>>::type type;
};
- template<std::size_t __i, typename _Tp>
+ template<size_t __i, typename _Tp>
struct tuple_element<__i, const volatile _Tp>
{
typedef typename add_cv<__tuple_element_t<__i, _Tp>>::type type;
// of tuple_element<pair<T,U>> and tuple_element<array<T,N>> are defined.
#define __cpp_lib_tuple_element_t 201402L
- template<std::size_t __i, typename _Tp>
+ template<size_t __i, typename _Tp>
using tuple_element_t = typename tuple_element<__i, _Tp>::type;
#endif
/// Partial specialization for std::pair
template<typename _T1, typename _T2>
- struct __is_tuple_like_impl<std::pair<_T1, _T2>> : true_type
+ struct __is_tuple_like_impl<pair<_T1, _T2>> : true_type
{ };
/// Partial specialization for std::pair
template<class _Tp1, class _Tp2>
- struct tuple_size<std::pair<_Tp1, _Tp2>>
- : public integral_constant<std::size_t, 2> { };
+ struct tuple_size<pair<_Tp1, _Tp2>>
+ : public integral_constant<size_t, 2> { };
/// Partial specialization for std::pair
template<class _Tp1, class _Tp2>
- struct tuple_element<0, std::pair<_Tp1, _Tp2>>
+ struct tuple_element<0, pair<_Tp1, _Tp2>>
{ typedef _Tp1 type; };
/// Partial specialization for std::pair
template<class _Tp1, class _Tp2>
- struct tuple_element<1, std::pair<_Tp1, _Tp2>>
+ struct tuple_element<1, pair<_Tp1, _Tp2>>
{ typedef _Tp2 type; };
- template<std::size_t _Int>
+ template<size_t _Int>
struct __pair_get;
template<>
struct __pair_get<0>
{
template<typename _Tp1, typename _Tp2>
- static constexpr _Tp1&
- __get(std::pair<_Tp1, _Tp2>& __pair) noexcept
- { return __pair.first; }
+ static constexpr _Tp1&
+ __get(pair<_Tp1, _Tp2>& __pair) noexcept
+ { return __pair.first; }
template<typename _Tp1, typename _Tp2>
- static constexpr _Tp1&&
- __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept
- { return std::forward<_Tp1>(__pair.first); }
+ static constexpr _Tp1&&
+ __move_get(pair<_Tp1, _Tp2>&& __pair) noexcept
+ { return std::forward<_Tp1>(__pair.first); }
template<typename _Tp1, typename _Tp2>
- static constexpr const _Tp1&
- __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept
- { return __pair.first; }
+ static constexpr const _Tp1&
+ __const_get(const pair<_Tp1, _Tp2>& __pair) noexcept
+ { return __pair.first; }
template<typename _Tp1, typename _Tp2>
- static constexpr const _Tp1&&
- __const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept
- { return std::forward<const _Tp1>(__pair.first); }
+ static constexpr const _Tp1&&
+ __const_move_get(const pair<_Tp1, _Tp2>&& __pair) noexcept
+ { return std::forward<const _Tp1>(__pair.first); }
};
template<>
struct __pair_get<1>
{
template<typename _Tp1, typename _Tp2>
- static constexpr _Tp2&
- __get(std::pair<_Tp1, _Tp2>& __pair) noexcept
- { return __pair.second; }
+ static constexpr _Tp2&
+ __get(pair<_Tp1, _Tp2>& __pair) noexcept
+ { return __pair.second; }
template<typename _Tp1, typename _Tp2>
- static constexpr _Tp2&&
- __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept
- { return std::forward<_Tp2>(__pair.second); }
+ static constexpr _Tp2&&
+ __move_get(pair<_Tp1, _Tp2>&& __pair) noexcept
+ { return std::forward<_Tp2>(__pair.second); }
template<typename _Tp1, typename _Tp2>
- static constexpr const _Tp2&
- __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept
- { return __pair.second; }
+ static constexpr const _Tp2&
+ __const_get(const pair<_Tp1, _Tp2>& __pair) noexcept
+ { return __pair.second; }
template<typename _Tp1, typename _Tp2>
- static constexpr const _Tp2&&
- __const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept
- { return std::forward<const _Tp2>(__pair.second); }
+ static constexpr const _Tp2&&
+ __const_move_get(const pair<_Tp1, _Tp2>&& __pair) noexcept
+ { return std::forward<const _Tp2>(__pair.second); }
};
- template<std::size_t _Int, class _Tp1, class _Tp2>
- constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&
- get(std::pair<_Tp1, _Tp2>& __in) noexcept
+ template<size_t _Int, class _Tp1, class _Tp2>
+ constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&
+ get(pair<_Tp1, _Tp2>& __in) noexcept
{ return __pair_get<_Int>::__get(__in); }
- template<std::size_t _Int, class _Tp1, class _Tp2>
- constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&&
- get(std::pair<_Tp1, _Tp2>&& __in) noexcept
+ template<size_t _Int, class _Tp1, class _Tp2>
+ constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&&
+ get(pair<_Tp1, _Tp2>&& __in) noexcept
{ return __pair_get<_Int>::__move_get(std::move(__in)); }
- template<std::size_t _Int, class _Tp1, class _Tp2>
- constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&
- get(const std::pair<_Tp1, _Tp2>& __in) noexcept
+ template<size_t _Int, class _Tp1, class _Tp2>
+ constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&
+ get(const pair<_Tp1, _Tp2>& __in) noexcept
{ return __pair_get<_Int>::__const_get(__in); }
- template<std::size_t _Int, class _Tp1, class _Tp2>
- constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&&
- get(const std::pair<_Tp1, _Tp2>&& __in) noexcept
+ template<size_t _Int, class _Tp1, class _Tp2>
+ constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&&
+ get(const pair<_Tp1, _Tp2>&& __in) noexcept
{ return __pair_get<_Int>::__const_move_get(std::move(__in)); }
#if __cplusplus >= 201402L