Reputation: 21837
I have code:
std::string firstFile = boost::filesystem::path(first->name()).leaf();
But get error:
error conversion from ‘boost::filesystem3::path’ to non-scalar type ‘std::string
How can i fix it?
Thank you.
Upvotes: 8
Views: 5571
Reputation: 72549
std::string firstFile = boost::filesystem::path(first->name()).leaf().string();
also note that the leaf
function is deprecated and is removed in Boost.Filesystem V3.
Upvotes: 12