63 #ifdef __GXX_EXPERIMENTAL_CXX0X__
67 namespace std _GLIBCXX_VISIBILITY(default)
69 _GLIBCXX_BEGIN_NAMESPACE_VERSION
71 #ifdef __GXX_EXPERIMENTAL_CXX0X__
82 template<std::size_t...>
87 template<
class _T1,
class _T2>
90 typedef _T1 first_type;
101 : first(), second() { }
104 _GLIBCXX_CONSTEXPR
pair(
const _T1& __a,
const _T2& __b)
105 : first(__a), second(__b) { }
108 #ifndef __GXX_EXPERIMENTAL_CXX0X__
109 template<
class _U1,
class _U2>
111 : first(__p.first), second(__p.second) { }
113 template<
class _U1,
class _U2,
class =
typename
114 enable_if<__and_<is_convertible<const _U1&, _T1>,
115 is_convertible<const _U2&, _T2>>::value>::type>
117 : first(__p.first), second(__p.second) { }
119 constexpr
pair(
const pair&) =
default;
123 template<
class _U1,
class =
typename
125 constexpr
pair(_U1&& __x,
const _T2& __y)
126 : first(std::
forward<_U1>(__x)), second(__y) { }
128 template<
class _U2,
class =
typename
129 enable_if<is_convertible<_U2, _T2>::value>::type>
130 constexpr pair(
const _T1& __x, _U2&& __y)
131 : first(__x), second(std::
forward<_U2>(__y)) { }
133 template<
class _U1,
class _U2,
class =
typename
134 enable_if<__and_<is_convertible<_U1, _T1>,
135 is_convertible<_U2, _T2>>::value>::type>
136 constexpr pair(_U1&& __x, _U2&& __y)
137 : first(std::
forward<_U1>(__x)), second(std::
forward<_U2>(__y)) { }
139 template<
class _U1,
class _U2,
class =
typename
140 enable_if<__and_<is_convertible<_U1, _T1>,
141 is_convertible<_U2, _T2>>::value>::type>
142 constexpr pair(pair<_U1, _U2>&& __p)
143 : first(std::
forward<_U1>(__p.first)),
144 second(std::
forward<_U2>(__p.second)) { }
146 template<
typename... _Args1,
typename... _Args2>
147 pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
150 operator=(
const pair& __p)
158 operator=(pair&& __p)
159 noexcept(__and_<is_nothrow_move_assignable<_T1>,
160 is_nothrow_move_assignable<_T2>>::value)
162 first = std::forward<first_type>(__p.first);
163 second = std::forward<second_type>(__p.second);
167 template<
class _U1,
class _U2>
169 operator=(
const pair<_U1, _U2>& __p)
176 template<
class _U1,
class _U2>
178 operator=(pair<_U1, _U2>&& __p)
180 first = std::forward<_U1>(__p.first);
181 second = std::forward<_U2>(__p.second);
187 noexcept(noexcept(swap(first, __p.first))
188 && noexcept(swap(second, __p.second)))
191 swap(first, __p.first);
192 swap(second, __p.second);
196 template<
typename... _Args1, std::size_t... _Indexes1,
197 typename... _Args2, std::size_t... _Indexes2>
198 pair(tuple<_Args1...>&, tuple<_Args2...>&,
199 _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
204 template<
class _T1,
class _T2>
205 inline _GLIBCXX_CONSTEXPR
bool
210 template<
class _T1,
class _T2>
211 inline _GLIBCXX_CONSTEXPR
bool
213 {
return __x.
first < __y.first
214 || (!(__y.first < __x.first) && __x.second < __y.second); }
217 template<
class _T1,
class _T2>
218 inline _GLIBCXX_CONSTEXPR
bool
220 {
return !(__x == __y); }
223 template<
class _T1,
class _T2>
224 inline _GLIBCXX_CONSTEXPR
bool
226 {
return __y < __x; }
229 template<
class _T1,
class _T2>
230 inline _GLIBCXX_CONSTEXPR
bool
232 {
return !(__y < __x); }
235 template<
class _T1,
class _T2>
236 inline _GLIBCXX_CONSTEXPR
bool
238 {
return !(__x < __y); }
240 #ifdef __GXX_EXPERIMENTAL_CXX0X__
244 template<
class _T1,
class _T2>
247 noexcept(noexcept(__x.swap(__y)))
263 #ifdef __GXX_EXPERIMENTAL_CXX0X__
265 template<
class _T1,
class _T2>
266 constexpr pair<typename __decay_and_strip<_T1>::__type,
267 typename __decay_and_strip<_T2>::__type>
270 typedef typename __decay_and_strip<_T1>::__type __ds_type1;
271 typedef typename __decay_and_strip<_T2>::__type __ds_type2;
273 return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
276 template<
class _T1,
class _T2>
277 inline pair<_T1, _T2>
279 {
return pair<_T1, _T2>(__x, __y); }
282 _GLIBCXX_END_NAMESPACE_VERSION
_T1 first
second_type is the second bound type
_T2 second
first is a copy of the first object
Primary class template, tuple.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
Define a member typedef type only if a boolean constant is true.
constexpr pair()
second is a copy of the second object
constexpr pair(const _T1 &__a, const _T2 &__b)
_T2 second_type
first_type is the first bound type
Struct holding two objects of arbitrary type.
constexpr piecewise_construct_t piecewise_construct
piecewise_construct
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 pair< _U1, _U2 > &__p)