初始化:
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");
pair的用法
时间: 2024-11-09 01:45:49