FreeBSD Manual Pages
std::pair(3) C++ Standard Libary std::pair(3) NAME std::pair - std::pair Synopsis Defined in header <utility> template< class T1, class T2 > struct pair; std::pair is a class template that provides a way to store two het- erogeneous objects as a single unit. A pair is a specific case of a std::tuple with two elements. If neither T1 nor T2 is a possibly cv-qualified class type with non- trivial destructor, or array thereof, the destructor of pair is trivial. Template parameters T1, T2 - the types of the elements that the pair stores. Member types Member type Definition first_type T1 second_type T2 Member objects Member name Type first T1 second T2 Member functions constructor constructs new pair (public member function) operator= assigns the contents (public member function) swap swaps the contents (C++11) (public member function) Non-member functions make_pair creates a pair object of type, defined by the argument types (function template) operator== operator!= operator< operator<= operator> operator>= lexicographically compares the values in the pair operator<=> (function template) (removed in C++20) (removed in C++20) (removed in C++20) (removed in C++20) (removed in C++20) (C++20) std::swap(std::pair) specializes the std::swap algorithm (C++11) (function template) std::get(std::pair) accesses an element of a pair (C++11) (function template) Helper classes std::tuple_size<std::pair> obtains the size of a pair (C++11) (class template specializa- tion) std::tuple_element<std::pair> obtains the type of the ele- ments of pair (C++11) (class template specializa- tion) std::basic_common_reference<std::pair> determines the common refer- ence type of two (C++23) pairs (class template specializa- tion) std::common_type<std::pair> determines the common type of two pairs (C++23) (class template specializa- tion) Deduction guides(since C++17) Defect reports The following behavior-changing defect reports were applied retroac- tively to previously published C++ standards. DR Applied to Behavior as published Correct behavior LWG 2796 C++98 triviality of the destructor of pair was specified unspecified See also tuple implements fixed size container, which holds elements of possibly different (C++11) types (class template) tie creates a tuple of lvalue references or unpacks a tuple into individual (C++11) objects (function template) http://cppreference.com 2022.07.31 std::pair(3)
NAME | Synopsis | Template parameters | Member types | Member objects | Member functions | Non-member functions | Helper classes | See also
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::pair&sektion=3&manpath=FreeBSD+Ports+15.0>
