이름공간
변수
행위

std::pair

cppreference.com
< cpp‎ | utility
<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. A pair is a specific case of a std::tuple with two elements.

목차

[편집] 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

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

[편집] Non-member functions

creates a pair object of type, defined by the argument types
(function template) [edit]
lexicographically compares the values in the pair
(function template) [edit]
specializes the std::swap algorithm
(function template) [edit]
accesses an element of a pair
(function template) [edit]

[편집] Helper classes

obtains the size of a pair
(class template specialization) [edit]
obtains the type of the elements of pair
(class template specialization) [edit]

[편집] See also

(C++11)
서로 다른 자료형의 원소를 저장할 수 있는 고정된 크기의 컨테이너를 구현
(class template) [edit]