---|---|---  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/utility/pair&action=edit&section=2
"Edit section: Member types") ]  Member types

Member type  |  Definition   
---|---  
` first_type ` |  ` T1 `  
` second_type ` |  ` T2 `  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/utility/pair&action=edit&section=3
"Edit section: Member objects") ]  Member objects

Member name  |  Type   
---|---  
` first ` |  ` T1 `  
` second ` |  ` T2 `  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/utility/pair&action=edit&section=4
"Edit section: Member functions") ]  Member functions

[ (constructor)  ](/w/cpp/utility/pair/pair "cpp/utility/pair/pair") |  constructs new ` pair `   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_constructor&action=edit)  
---|---  
[ operator=  ](/w/cpp/utility/pair/operator%3D "cpp/utility/pair/operator=") |  assigns the contents   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_operator%3D&action=edit)  
[ swap  ](/w/cpp/utility/pair/swap "cpp/utility/pair/swap") (C++11)  |  swaps the contents   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_swap&action=edit)  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/utility/pair&action=edit&section=5
"Edit section: Non-member functions") ]  Non-member functions

[ make_pair  ](/w/cpp/utility/pair/make_pair "cpp/utility/pair/make pair") |  creates a ` pair ` object of type, defined by the argument types   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_make_pair&action=edit)  
---|---  
[ operator==  operator!=  operator< operator<=  operator> operator>=  operator<=> ](/w/cpp/utility/pair/operator_cmp "cpp/utility/pair/operator cmp") (removed in C++20)  (removed in C++20)  (removed in C++20)  (removed in C++20)  (removed in C++20)  (C++20)  |  lexicographically compares the values in the ` pair `   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_operator_cmp&action=edit)  
[ std::swap  (std::pair)  ](/w/cpp/utility/pair/swap2 "cpp/utility/pair/swap2") (C++11)  |  specializes the  [ std::swap ](/w/cpp/algorithm/swap "cpp/algorithm/swap") algorithm   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_swap2&action=edit)  
[ get  (std::pair)  ](/w/cpp/utility/pair/get "cpp/utility/pair/get") (C++11)  |  accesses an element of a ` pair `   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_get&action=edit)  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/utility/pair&action=edit&section=6
"Edit section: Helper classes") ]  Helper classes

[ std::tuple_size  <std::pair> ](/w/cpp/utility/pair/tuple_size "cpp/utility/pair/tuple size") (C++11)  |  obtains the size of a ` pair `   
(class template specialization)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_tuple_size&action=edit)  
---|---  
[ std::tuple_element  <std::pair> ](/w/cpp/utility/pair/tuple_element "cpp/utility/pair/tuple element") (C++11)  |  obtains the type of the elements of ` pair `   
(class template specialization)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_tuple_element&action=edit)  
[ std::basic_common_reference  <std::pair> ](/w/cpp/utility/pair/basic_common_reference "cpp/utility/pair/basic common reference") (C++23)  |  determines the common reference type of two ` pair ` s   
(class template specialization)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/dsc_basic_common_reference&action=edit)  
[ std::common_type  <std::pair> ](/w/cpp/utility/pair/common_type "cpp/utility/pair/common type") (C++23)  |  de