C++ 从‘;boost::filesystem3::path’;到非标量类型‘;字符串
我有密码:C++ 从‘;boost::filesystem3::path’;到非标量类型‘;字符串,c++,string,boost,std,C++,String,Boost,Std,我有密码: std::string firstFile = boost::filesystem::path(first->name()).leaf(); 但是得到错误: error conversion from ‘boost::filesystem3::path’ to non-scalar type ‘std::string 我怎样才能修好它 多谢各位 std::string firstFile = boost::filesystem::path(first->name())
std::string firstFile = boost::filesystem::path(first->name()).leaf();
但是得到错误:
error conversion from ‘boost::filesystem3::path’ to non-scalar type ‘std::string
我怎样才能修好它
多谢各位
std::string firstFile = boost::filesystem::path(first->name()).leaf().string();
还请注意,leaf
函数已弃用,并已在Boost.Filesystem V3中删除。有关弃用函数的列表,请参阅