make pair usuage
The behavior of this function template is the same as if defined as: 1 2 3 4 5 template < class T1, class T2> pair<T1,T2> make_pair (T1 x, T2 y) { return ( pair<T1,T2>(x,y) ); } // make_pair example #include <utility> // std::pair #include <iostream> // std::cout int main () { std::pair < int , int > foo; std::pair < int , int > bar; foo = std::make_pair (10,20); bar = std::make_pair (10.5, 'A' ); // ok: implicit conversion from pair<double,char> std::cout << "foo: " << foo.first << ", " << foo.second << '\n' ; std::cout << "bar: " << bar.first << ", " << bar.second << '\n' ; return 0; } The difference is that with std::pair you need to specify the types of both elements, whereas std::make_pair will create a pair with the type of the elements that are ...