首页 > 代码库 > pair的用法

pair的用法

初始化:

  std::pair<int, float> p; //initialize p.first and p.second with zero

  std::pair<int, const char*> p(42, "hello");

  make_pair(42, "hello"); // no need for the var name, it‘s returned by make_pair

  make_pair<int, float>(42, "hello");