std::filesystem::recursive_directory_iterator::operator++, std::filesystem::recursive_directory_iterator::increment

recursive_directory_iterator& operator++();
(since C++17)
recursive_directory_iterator& increment( std::error_code& ec ) noexcept;
(since C++17)

Advances the iterator to the next entry.

If there are no more entries left in the currently iterated directory, the iteration is resumed over the parent directory. The process is repeated if the parent directory has no sibling entries that can to be iterated on. If the parent of the directory hierarchy that has been recursively iterated on is reached (there are no candidate entries at depth() == 0), *this is set to an end iterator.

Otherwise, if *this refers to a directory, it is iterated into if the following conditions are met:

  • disable_recursion_pending() has not been called before this increment, i.e. recursion_pending() == true.
  • The directory is not a symlink or following symlinks is enabled, i.e., at least one of the following is true:
    • !is_symlink((*this)->symlink_status()).
    • (options() & directory_options::follow_directory_symlink) != directory_options::none)

[edit] Parameters

ec - error code to store the error status to

[edit] Return value


[edit] Exceptions

1) std::filesystem::filesystem_error if an error occurs.
2) The error code is set to an appropriate error code for the error that caused the failure.