【发布时间】:2011-03-21 07:08:31
【问题描述】:
我有代码:
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();
但得到错误:
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 中被删除。
【讨论】: