61 #if __cplusplus >= 201103L
62 #include <type_traits>
65 namespace std _GLIBCXX_VISIBILITY(default)
67 _GLIBCXX_BEGIN_NAMESPACE_VERSION
74 #if __cplusplus >= 201103L
85 template<std::size_t...>
95 template<
class _T1,
class _T2>
98 typedef _T1 first_type;
109 : first(), second() { }
112 _GLIBCXX_CONSTEXPR
pair(
const _T1& __a,
const _T2& __b)
113 : first(__a), second(__b) { }
116 #if __cplusplus < 201103L
117 template<
class _U1,
class _U2>
119 : first(__p.first), second(__p.second) { }
121 template<
class _U1,
class _U2,
class =
typename
122 enable_if<__and_<is_convertible<const _U1&, _T1>,
123 is_convertible<const _U2&, _T2>>::value>::type>
125 : first(__p.first), second(__p.second) { }
127 constexpr
pair(
const pair&) =
default;
131 template<
class _U1,
class =
typename
132 enable_if<is_convertible<_U1, _T1>::value>::type>
133 constexpr
pair(_U1&& __x,
const _T2& __y)
134 : first(
std::
forward<_U1>(__x)), second(__y) { }
136 template<
class _U2,
class =
typename
137 enable_if<is_convertible<_U2, _T2>::value>::type>
138 constexpr pair(
const _T1& __x, _U2&& __y)
139 : first(__x), second(
std::
forward<_U2>(__y)) { }
141 template<
class _U1,
class _U2,
class =
typename
142 enable_if<__and_<is_convertible<_U1, _T1>,
143 is_convertible<_U2, _T2>>::value>::type>
144 constexpr pair(_U1&& __x, _U2&& __y)
147 template<
class _U1,
class _U2,
class =
typename
148 enable_if<__and_<is_convertible<_U1, _T1>,
149 is_convertible<_U2, _T2>>::value>::type>
150 constexpr pair(pair<_U1, _U2>&& __p)
154 template<
typename... _Args1,
typename... _Args2>
155 pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
158 operator=(
const pair& __p)
166 operator=(pair&& __p)
167 noexcept(__and_<is_nothrow_move_assignable<_T1>,
168 is_nothrow_move_assignable<_T2>>::value)
170 first = std::forward<first_type>(__p.first);
171 second = std::forward<second_type>(__p.second);
175 template<
class _U1,
class _U2>
177 operator=(
const pair<_U1, _U2>& __p)
184 template<
class _U1,
class _U2>
186 operator=(pair<_U1, _U2>&& __p)
188 first = std::forward<_U1>(__p.first);
189 second = std::forward<_U2>(__p.second);
195 noexcept(noexcept(
swap(first, __p.first))
196 && noexcept(
swap(second, __p.second)))
199 swap(first, __p.first);
200 swap(second, __p.second);
204 template<
typename... _Args1, std::size_t... _Indexes1,
205 typename... _Args2, std::size_t... _Indexes2>
206 pair(tuple<_Args1...>&, tuple<_Args2...>&,
207 _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
212 template<
class _T1,
class _T2>
213 inline _GLIBCXX_CONSTEXPR
bool
218 template<
class _T1,
class _T2>
219 inline _GLIBCXX_CONSTEXPR
bool
221 {
return __x.
first < __y.first
222 || (!(__y.first < __x.first) && __x.second < __y.second); }
225 template<
class _T1,
class _T2>
226 inline _GLIBCXX_CONSTEXPR
bool
228 {
return !(__x == __y); }
231 template<
class _T1,
class _T2>
232 inline _GLIBCXX_CONSTEXPR
bool
234 {
return __y < __x; }
237 template<
class _T1,
class _T2>
238 inline _GLIBCXX_CONSTEXPR
bool
240 {
return !(__y < __x); }
243 template<
class _T1,
class _T2>
244 inline _GLIBCXX_CONSTEXPR
bool
246 {
return !(__x < __y); }
248 #if __cplusplus >= 201103L
252 template<
class _T1,
class _T2>
255 noexcept(noexcept(__x.swap(__y)))
271 #if __cplusplus >= 201103L
273 template<
class _T1,
class _T2>
274 constexpr pair<typename __decay_and_strip<_T1>::__type,
275 typename __decay_and_strip<_T2>::__type>
278 typedef typename __decay_and_strip<_T1>::__type __ds_type1;
279 typedef typename __decay_and_strip<_T2>::__type __ds_type2;
281 return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
284 template<
class _T1,
class _T2>
285 inline pair<_T1, _T2>
287 {
return pair<_T1, _T2>(__x, __y); }
292 _GLIBCXX_END_NAMESPACE_VERSION
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
constexpr pair< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > make_pair(_T1 &&__x, _T2 &&__y)
A convenience wrapper for creating a pair from two objects.
constexpr pair(const _T1 &__a, const _T2 &__b)
constexpr piecewise_construct_t piecewise_construct
piecewise_construct
_T1 first
second_type is the second bound type
ISO C++ entities toplevel namespace is std.
_T2 second_type
first_type is the first bound type
bool operator>=(const basic_string< _CharT, _Traits, _Alloc > &__lhs, const basic_string< _CharT, _Traits, _Alloc > &__rhs)
Test if string doesn't precede string.
bool operator>(const basic_string< _CharT, _Traits, _Alloc > &__lhs, const basic_string< _CharT, _Traits, _Alloc > &__rhs)
Test if string follows string.
Struct holding two objects of arbitrary type.
constexpr pair()
second is a copy of the second object
void swap(_Tp &, _Tp &) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp >>::value)
Swaps two values.
constexpr pair(const pair< _U1, _U2 > &__p)
_T2 second
first is a copy of the first object