Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/126.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 从‘;boost::filesystem3::path’;到非标量类型‘;字符串_C++_String_Boost_Std - Fatal编程技术网

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中删除。

有关弃用函数的列表,请参阅