We recommend using Visual Studio 2017

pair (STL/CLR)

 

The latest version of this topic can be found at pair (STL/CLR).

The template class describes an object that wraps a pair of values.

template<typename Value1,  
    typename Value2>  
    ref class pair;  

Parameters

Value1
The type of first wrapped value.

Value2
The type of second wrapped value.

Type DefinitionDescription
pair::first_type (STL/CLR)The type of the first wrapped value.
pair::second_type (STL/CLR)The type of the second wrapped value.
Member ObjectDescription
pair::first (STL/CLR)The first stored value.
pair::second (STL/CLR)The second stored value.
Member FunctionDescription
pair::pair (STL/CLR)Constructs a pair object.
pair::swap (STL/CLR)Swaps the contents of two pairs.
OperatorDescription
pair::operator= (STL/CLR)Replaces the stored pair of values.

The object stores a pair of values. You use this template class to combine two values into a single object. Note that cliext::pair (described here) stores only managed types; to store a pair of unmanaged types use std::pair, declared in <utility>.

Header: <cliext/utility>

Namespace: cliext

make_pair (STL/CLR)

Show: