在boost 1.48之后 ,filesystem 改成了v3版本,而path的存储格式根据应用的系统而不同,在windows XP 以及mingw下,内部存储为了wchart_t格式,要想获得char*格式的结果,需要使用模板化的 string 函数获得,代码如下 :
boost::filesystem::path p;
...
std::string str_of_chars = p.string<std::string>();
在boost 1.48之后 ,filesystem 改成了v3版本,而path的存储格式根据应用的系统而不同,在windows XP 以及mingw下,内部存储为了wchart_t格式,要想获得char*格式的结果,需要使用模板化的 string 函数获得,代码如下 :
boost::filesystem::path p;
...
std::string str_of_chars = p.string<std::string>();