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&)
的模板,並嘗試靜態轉換該函數,但都未成功。在std算法中反向提升is_directory
我知道我可以求助於一個lamdba,但是如果它工作的話這個更清潔。
由於
你收到了什麼錯誤? –