recursive_directory_iterator::pop()
is under-specifiedSection: 31.12.12 [fs.class.rec.dir.itr] Status: C++17 Submitter: Eric Fiselier Opened: 2016-05-09 Last modified: 2017-07-30
Priority: 0
View all issues with C++17 status.
Discussion:
Unlike increment
, pop()
does not specify how it reports errors nor does it provide a
std::error_code
overload. However implementing pop()
all but requires performing an increment,
so it should handle errors in the same way.
Proposed resolution:
This wording is relative to N4582.
Change 31.12.12 [fs.class.rec.dir.itr], class recursive_directory_iterator
synopsis, as indicated:
namespace std::filesystem { class recursive_directory_iterator { public: […] void pop(); void pop(error_code& ec); void disable_recursion_pending(); […] }; }
Change 31.12.12.2 [fs.rec.dir.itr.members] as indicated:
void pop(); void pop(error_code& ec);-30- Requires:
-31- Effects: If*this != recursive_directory_iterator()
.depth() == 0
, set*this
torecursive_directory_iterator()
. Otherwise, cease iteration of the directory currently being iterated over, and continue iteration over the parent directory. -?- Throws: As specified in Error reporting (31.5.6 [error.reporting]).