Syntaxe:
pair<T1,T2> make_pair( const T1 &a, const T2 &b );
make_pair funkce vrátí jednoduchý objekt obsahující dvě položky a a b. make_pair je jedna z možností jak vytvořit instanci třídy pair.
Například:
#include <string> using std::string; #include <iostream> using std::cout; #include <utility> using std::pair; using std::make_pair; int main () { pair<int,string> tuple = make_pair( 42, "The answer" ); cout << "tuple.first: " << tuple.first << ", tuple.second: " << tuple.second << '\n'; return 0; }