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
as指定模板bool(*)(const boost::filesystem::path&)
并尝试静态转换该函数,但均未成功。
我知道我可以求助于 lamdba,但如果它有效,这会更干净。
谢谢