I have a code:
std::string firstFile = boost::filesystem::path(first->name()).leaf();
But the error will turn out:
error conversion from 'boost::filesystem3::path' to non-scalar type 'std::string
How can i fix this?
Thanks.
std::string firstFile = boost::filesystem::path(first->name()).leaf().string();
Also note that the leaf function is deprecated and removed in Boost.Filesystem V3.
leaf