1// make_pair example
2#include <utility> // std::pair
3#include <iostream> // std::cout
4
5int main () {
6 std::pair <int,int> foo;
7 std::pair <int,int> bar;
8
9 foo = std::make_pair (10,20);
10 bar = std::make_pair (10.5,'A'); // ok: implicit conversion from pair<double,char>
11
12 std::cout << "foo: " << foo.first << ", " << foo.second << '\n';
13 std::cout << "bar: " << bar.first << ", " << bar.second << '\n';
14
15 return 0;
16}