std::make_pair (3) - Linux Manuals
std::make_pair: std::make_pair
NAME
std::make_pair - std::make_pair
Synopsis
Defined in header <utility>
template< class T1, class T2 > (until C++11)
std::pair<T1,T2> make_pair( T1 t, T2 u );
template< class T1, class T2 > (since C++11)
std::pair<V1,V2> make_pair( T1&& t, T2&& u ); (until C++14)
template< class T1, class T2 > (since C++14)
constexpr std::pair<V1,V2> make_pair( T1&& t, T2&& u );
Creates a std::pair object, deducing the target type from the types of arguments.
The deduced types V1 and V2 are std::decay<T1>::type and std::decay<T2>::type (the usual type transformations applied to arguments of functions passed by value) unless application of std::decay results in std::reference_wrapper<X> for some type X, in which case the deduced type is X&. (since C++11)
Parameters
t, u - the values to construct the pair from
Return value
An std::pair object containing the given values.
Example
// Run this code
Output: