Namespaces
Variants
Views
Actions

std::pair

From cppreference.com
< cpp‎ | utility
Revision as of 13:05, 23 August 2011 by P12 (Talk | contribs)

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 functions

constructs new pair
(public member function)
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

Template:cpp/utility/pair/dcl list operator compTemplate:cpp/utility/pair/dcl list std swap
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

obtains the size of a pair similar to tuple
(class template)
obtains the type of the elements of pair similar to tuple
(class template)
disambiguates constructor and function overloading for piecewise construction
(class)