Difference between revisions of "cpp/utility/pair"
From cppreference.com
(piecewise belongs here, also tuple-like metafunctions are defined for pairs as well.) |
m (er, get is a function) |
||
Line 36: | Line 36: | ||
{{dcl list template | cpp/utility/pair/dcl list operator_comp}} | {{dcl list template | cpp/utility/pair/dcl list operator_comp}} | ||
{{dcl list template | cpp/utility/pair/dcl list std_swap}} | {{dcl list template | cpp/utility/pair/dcl list std_swap}} | ||
+ | {{dcl list tfun | cpp/utility/tuple/get | accesses an element of a {{rlt|pair}} similar to {{rlt|tuple}} | notes={{mark c++11}}}} | ||
{{dcl list end}} | {{dcl list end}} | ||
===Helper classes=== | ===Helper classes=== | ||
{{dcl list begin}} | {{dcl list begin}} | ||
− | |||
{{dcl list tclass | cpp/utility/tuple/tuple_size | obtains the size of a {{rlt|pair}} similar to {{rlt|tuple}} | notes={{mark c++11}}}} | {{dcl list tclass | cpp/utility/tuple/tuple_size | obtains the size of a {{rlt|pair}} similar to {{rlt|tuple}} | notes={{mark c++11}}}} | ||
{{dcl list tclass | cpp/utility/tuple/tuple_element | obtains the type of the elements of {{rlt|pair}} similar to {{rlt|tuple}} | notes={{mark c++11}}}} | {{dcl list tclass | cpp/utility/tuple/tuple_element | obtains the type of the elements of {{rlt|pair}} similar to {{rlt|tuple}} | notes={{mark c++11}}}} | ||
{{dcl list class | cpp/utility/tuple/piecewise_construct_t | disambiguates constructor and function overloading for piecewise construction | notes={{mark c++11}}}} | {{dcl list class | cpp/utility/tuple/piecewise_construct_t | disambiguates constructor and function overloading for piecewise construction | notes={{mark c++11}}}} | ||
{{dcl list end}} | {{dcl list end}} |
Revision as of 19:59, 22 August 2011
Template:cpp/utility/pair/sidebar
Defined in header <utility>
|
||
template< class T1, |
||
std::pair
is a struct template that provides a way to store two heterogeneous objects as a single unit.
Contents |
Member functions
assigns the contents (public member function) | |
swaps the contents (public member function) |
Member types
Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list end
Template:tdcl list begin Template:tdcl list h1 Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list end
Non-member functions
creates a pair object of type, defined by the argument types (function template) | |
(C++11) |
accesses an element of a pair similar to tuple (function template) |
Helper classes
(C++11) |
obtains the size of a pair similar to tuple (class template) |
(C++11) |
obtains the type of the elements of pair similar to tuple (class template) |
(C++11) |
disambiguates constructor and function overloading for piecewise construction (class) |