Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/utility/pair"

From cppreference.com
< cpp‎ | utility
(reorder section)
(+piecewise_construct)
Line 43: Line 43:
 
{{dcl list template | cpp/utility/pair/dcl list tuple_size}}
 
{{dcl list template | cpp/utility/pair/dcl list tuple_size}}
 
{{dcl list template | cpp/utility/pair/dcl list tuple_element}}
 
{{dcl list template | cpp/utility/pair/dcl list tuple_element}}
 +
{{dcl list template | cpp/utility/pair/dcl list piecewise_construct_t}}
 +
{{dcl list end}}
 +
 +
===Helper objects===
 +
{{dcl list begin}}
 
{{dcl list template | cpp/utility/pair/dcl list piecewise_construct}}
 
{{dcl list template | cpp/utility/pair/dcl list piecewise_construct}}
 
{{dcl list end}}
 
{{dcl list end}}

Revision as of 11:26, 26 August 2011

Template:cpp/utility/pair/sidebar

Defined in header <utility>
template<

    class T1,
    class T2

> struct pair;

std::pair is a struct template that provides a way to store two heterogeneous objects as a single unit.

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list end

Member objects

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list end

Member functions

constructs new pair
(public member function)
assigns the contents
(public member function)
(C++11)
swaps the contents
(public member function)

Non-member functions

Template:cpp/utility/pair/dcl list operator compTemplate:cpp/utility/pair/dcl list std swap
creates a pair object of type, determined by the argument types
(function template) [edit]
accesses an element of a pair
(function template) [edit]

Helper classes

Template:cpp/utility/pair/dcl list piecewise construct t
obtains the size of a pair
(class template specialization) [edit]
obtains the type of the elements of pair
(class template specialization) [edit]

Helper objects

Template:cpp/utility/pair/dcl list piecewise construct