61 #if __cplusplus >= 201103L
62 #include <type_traits>
67 _GLIBCXX_BEGIN_NAMESPACE_VERSION
74 #if __cplusplus >= 201103L
75 struct piecewise_construct_t { };
79 constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
95 template<
class _T1,
class _T2>
98 typedef _T1 first_type;
99 typedef _T2 second_type;
108 _GLIBCXX_CONSTEXPR pair()
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>
118 pair(
const pair<_U1, _U2>& __p)
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>
124 constexpr pair(
const pair<_U1, _U2>& __p)
125 : first(__p.first), second(__p.second) { }
127 constexpr pair(
const pair&) =
default;
128 constexpr pair(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)
145 : first(std::forward<_U1>(__x)), second(std::forward<_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)
151 : first(std::forward<_U1>(__p.first)),
152 second(std::forward<_U2>(__p.second)) { }
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,
206 pair(tuple<_Args1...>&, tuple<_Args2...>&,
207 _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
212 template<
class _T1,
class _T2>
213 inline _GLIBCXX_CONSTEXPR
bool
214 operator==(
const pair<_T1, _T2>& __x,
const pair<_T1, _T2>& __y)
215 {
return __x.first == __y.first && __x.second == __y.second; }
218 template<
class _T1,
class _T2>
219 inline _GLIBCXX_CONSTEXPR
bool
220 operator<(const pair<_T1, _T2>& __x,
const pair<_T1, _T2>& __y)
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
227 operator!=(
const pair<_T1, _T2>& __x,
const pair<_T1, _T2>& __y)
228 {
return !(__x == __y); }
231 template<
class _T1,
class _T2>
232 inline _GLIBCXX_CONSTEXPR
bool
233 operator>(
const pair<_T1, _T2>& __x,
const pair<_T1, _T2>& __y)
234 {
return __y < __x; }
237 template<
class _T1,
class _T2>
238 inline _GLIBCXX_CONSTEXPR
bool
239 operator<=(const pair<_T1, _T2>& __x,
const pair<_T1, _T2>& __y)
240 {
return !(__y < __x); }
243 template<
class _T1,
class _T2>
244 inline _GLIBCXX_CONSTEXPR
bool
245 operator>=(
const pair<_T1, _T2>& __x,
const pair<_T1, _T2>& __y)
246 {
return !(__x < __y); }
248 #if __cplusplus >= 201103L
252 template<
class _T1,
class _T2>
254 swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
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>
276 make_pair(_T1&& __x, _T2&& __y)
278 typedef typename __decay_and_strip<_T1>::__type __ds_type1;
279 typedef typename __decay_and_strip<_T2>::__type __ds_type2;
280 typedef pair<__ds_type1, __ds_type2> __pair_type;
281 return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
284 template<
class _T1,
class _T2>
285 inline pair<_T1, _T2>
286 make_pair(_T1 __x, _T2 __y)
287 {
return pair<_T1, _T2>(__x, __y); }
292 _GLIBCXX_END_NAMESPACE_VERSION
bool operator>=(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:644
bool operator==(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))
namespace std _GLIBCXX_VISIBILITY(default)
Definition: auto_ptr.h:36
bool operator>(const _Safe_iterator< _IteratorL, _Sequence > &__lhs, const _Safe_iterator< _IteratorR, _Sequence > &__rhs)
Definition: safe_iterator.h:612
bool operator!=(const exception_ptr &, const exception_ptr &) _GLIBCXX_USE_NOEXCEPT __attribute__((__pure__))
__SIZE_TYPE__ size_t
Definition: stddef.h:212
void swap(exception_ptr &__lhs, exception_ptr &__rhs)
Definition: exception_ptr.h:160