Reference

class template
<utility>

std::pair

template <class T1, class T2> struct pair;
Pair of values
This class couples together a pair of values, which may be of different types (T1 and T2). The individual values can be accessed through its public members first and second.

Pairs are a particular case of tuple .

Template parameters

T1
Type of member first, aliased as first_type.
T2
Type of member second, aliased as second_type.

Member types

member typedefinitionnotes
first_typeThe first template parameter (T1)Type of member first.
second_typeThe second template parameter (T2)Type of member second.

Member variables

member variabledefinition
firstThe first value in the pair
secondThe second value in the pair

Member functions

(constructor)
Construct pair (public member function)
pair::operator=
Assign contents (public member function)
pair::swap
Swap contents (public member function)

Non-member function overloads

relational operators (pair)
Relational operators for pair (function template)
swap (pair)
Exchanges the contents of two pairs (function template)
get (pair)
Get element (tuple interface) (function template)

Non-member class specializations

tuple_element<pair>
Tuple element type for pair (class template specialization)
tuple_size<pair>
Tuple traits for pair (class template specialization)

See also

make_pair
Construct pair object (function template)
piecewise_construct
Piecewise construct constant (constant)

AltStyle によって変換されたページ (->オリジナル) /