【发布时间】:2011-11-20 05:39:18
【问题描述】:
boost::filesystem::recursive_directory_iterator end, begin(directory);
auto num_of_files=std::count_if(begin, end,
std::not1(boost::filesystem::is_directory)));
我试图否定上述目录迭代器上的函数 is_directory ,但我遇到了障碍。我尝试将not1 的模板指定为bool(*)(const boost::filesystem::path&),并尝试静态转换函数均未成功。
我知道我可以求助于 lamdba,但如果它有效,这会更干净。
谢谢
【问题讨论】: