Pau*_*ulH 0 c++ string stl std-pair
我有一个Visual Studio 2008 C++应用程序,其中包含一个const char*[2]我想要转换为a的参数std::pair< std::string, std::string >.有一个简单的方法吗?
例如:
typedef std::pair< std::string, std::string > Group;
const char* a[ 2 ] = { "buzz", "foo" };
Group z = a; // ???
// a->first.c_str() == "buzz"
// a->second.c_str() == "foo"
Run Code Online (Sandbox Code Playgroud)
谢谢,PaulH