function std::make pair

From Cppwiki

Jump to: navigation, search
The correct title of this page is "std::make_pair". The displayed title is incorrect for technical or other reasons.

std::make_pair is a function defined by the C++ Standard Library. It is a helper function for creating an object of type std::pair.

Include <utility> to use std::make_pair.

template<typename First, typename Second>

 pair<First, Second> make_pair(First first, Second second);

Using std::make_pair is generally easier than creating a std::pair directly because function templates can take advantage of argument deduction.

See also: <utility>, std::pair

Personal tools