noexcept") (C++11)  
[ as_const  ](/w/cpp/utility/as_const "cpp/utility/as const") (C++17)  
  
Common vocabulary types  
|  [ pair  ](/w/cpp/utility/pair "cpp/utility/pair")  
---  
[ tuple  ](/w/cpp/utility/tuple "cpp/utility/tuple") (C++11)  
[ optional  ](/w/cpp/utility/optional "cpp/utility/optional") (C++17)  
[ any  ](/w/cpp/utility/any "cpp/utility/any") (C++17)  
[ variant  ](/w/cpp/utility/variant "cpp/utility/variant") (C++17)  
  
|  [ tuple_size  ](/w/cpp/utility/tuple_size "cpp/utility/tuple size") (C++11)  
---  
[ tuple_element  ](/w/cpp/utility/tuple_element "cpp/utility/tuple element")
(C++11)  
[ apply  ](/w/cpp/utility/apply "cpp/utility/apply") (C++17)  
[ make_from_tuple  ](/w/cpp/utility/make_from_tuple "cpp/utility/make from
tuple") (C++17)  
[ expected  ](/w/cpp/utility/expected "cpp/utility/expected") (C++23)  
  
[ Elementary string conversions ](/w/cpp/utility#Elementary_string_conversions
"cpp/utility")  
|  [ to_chars  ](/w/cpp/utility/to_chars "cpp/utility/to chars") (C++17)  
---  
[ from_chars  ](/w/cpp/utility/from_chars "cpp/utility/from chars") (C++17)  
[ chars_format  ](/w/cpp/utility/chars_format "cpp/utility/chars format")
(C++17)  
  
|  [ to_chars_result  ](/w/cpp/utility/to_chars_result "cpp/utility/to chars
result") (C++17)  
---  
[ from_chars_result  ](/w/cpp/utility/from_chars_result "cpp/utility/from
chars result") (C++17)  
  
  
  
  
  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/navbar_content&action=edit)

[ ` std::pair ` ](/w/cpp/utility/pair "cpp/utility/pair")

Member functions  
---  
[ pair::pair  ](/w/cpp/utility/pair/pair "cpp/utility/pair/pair")  
[ pair::operator=  ](/w/cpp/utility/pair/operator%3D
"cpp/utility/pair/operator=")  
[ pair::swap  ](/w/cpp/utility/pair/swap "cpp/utility/pair/swap") (C++11)  
Non-member functions  
[ make_pair  ](/w/cpp/utility/pair/make_pair "cpp/utility/pair/make pair")  
[ operator==  operator!=  operator< operator<=  operator> operator>=
operator<=> ](/w/cpp/utility/pair/operator_cmp "cpp/utility/pair/operator
cmp") (until C++20)  (until C++20)  (until C++20)  (until C++20)  (until
C++20)  (C++20)  
[ swap  (std::pair)  ](/w/cpp/utility/pair/swap2 "cpp/utility/pair/swap2")
(C++11)  
[ get  (std::pair)  ](/w/cpp/utility/pair/get "cpp/utility/pair/get") (C++11)  
[ Deduction guides ](/w/cpp/utility/pair/deduction_guides
"cpp/utility/pair/deduction guides") (C++17)  
Helper classes  
** tuple_size  <std::pair> ** (C++11)  
[ tuple_element  <std::pair> ](/w/cpp/utility/pair/tuple_element
"cpp/utility/pair/tuple element") (C++11)  
[ basic_common_reference  <std::pair>
](/w/cpp/utility/pair/basic_common_reference "cpp/utility/pair/basic common
reference") (C++23)  
[ common_type  <std::pair> ](/w/cpp/utility/pair/common_type
"cpp/utility/pair/common type") (C++23)  
[ formatter  <std::pair> ](/w/cpp/utility/format/tuple_formatter
"cpp/utility/format/tuple formatter") (C++23)  
[ piecewise_construct_t  ](/w/cpp/utility/piecewise_construct
"cpp/utility/piecewise construct") (C++11)  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/utility/pair/navbar_content&action=edit)

Defined in header ` [ <utility> ](/w/cpp/header/utility "cpp/header/utility") ` |  |   
---|---|---  
template  < class  T1,  class  T2  >  
struct  tuple_size  < [ std::  pair
](http://en.cppreference.com/w/cpp/utility/pair) < T1, T2  >>  
:  [ std::  integral_constant  ](http://en.cppreference.com/w/cpp/types/integral_constant) < [ std::  size_t  ](http://en.cppreference.com/w/cpp/types/size_t) ,  2  > {  }  ;  |  |  (since C++11)   
|  |   
  
The partial specialization of  [ std::  tuple_size
](http://en.cppreference.com/w/cpp/utility/tuple_size) for pairs provides a
compile-time way to obtain the number of elements in a pair, which is always
2, using tuple-like syntax.

##  Contents

  * 1  Inherited from  std::  integral_constant 
    * 1.1  Member constants 
    * 1.2  Member functions 
    * 1.3