29 #include <boost/type_traits.hpp> 36 template<
class _T1,
class _T2>
53 pair(
typename boost::remove_reference<_T1>::type& __a,
54 typename boost::remove_reference<_T2>::type& __b) :
55 first(__a), second(__b) {
59 template<
class _U1,
class _U2>
61 first(__p.first), second(__p.second) {
66 template<
class _T1,
class _T2>
72 template<
class _T1,
class _T2>
73 inline bool operator<(const pair<_T1, _T2>& __x,
const pair<_T1, _T2>& __y) {
74 return __x.
first < __y.first || (!(__y.first < __x.first) && __x.second
79 template<
class _T1,
class _T2>
85 template<
class _T1,
class _T2>
91 template<
class _T1,
class _T2>
92 inline bool operator<=(const pair<_T1, _T2>& __x,
const pair<_T1, _T2>& __y) {
97 template<
class _T1,
class _T2>
114 template<
class _T1,
class _T2>
pair(const pair< _U1, _U2 > &__p)
There is also a templated copy ctor for the pair class itself.
pair< _T1, _T2 > make_pair(_T1 __x, _T2 __y)
A convenience wrapper for creating a pair from two objects.
_T2 second_type
second_type is the second bound type
_T2 second
second is a copy of the second object
_T1 first_type
first_type is the first bound type
bool operator>(const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
Uses operator< to find the result.
pair(typename boost::remove_reference< _T1 >::type &__a, typename boost::remove_reference< _T2 >::type &__b)
Two objects may be passed to a pair constructor to be copied.
_T1 first
first is a copy of the first object
bool operator>=(const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
Uses operator< to find the result.
pair holds two objects of arbitrary type.
bool operator==(const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
Two pairs of the same type are equal iff their members are equal.
bool operator!=(const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
Uses operator== to find the result.
pair()
The default constructor creates first and second using their respective default constructors.