c++ - Boost directory_iterator error: no match for operator!= -
i'm starting c++ boost libraries. i'm running issue directory_iterator , recursive_directory_iterator. when try compile following code, no match operator!=. have tried == no avail.
const boost::filesystem::recursive_directory_iterator end(); for(boost::filesystem::recursive_directory_iterator i(p); != end; i++){ if(boost::filesystem::is_regular_file(i->status())){ cout << i->path().filename() << endl; } } any help? thanks!
const boost::filesystem::recursive_directory_iterator end() not define variable end instead declares function prototype function end returns const boost::filesystem::recursive_directory_iterator , not take arguments (search "c++ vexing parse" understand why happens). change const boost::filesystem::recursive_directory_iterator end;.
Comments
Post a Comment