Date
2016-12-19.13:38:24
Message id
8762

Content

directory_iterator::increment and recursive_directory_iterator::increment are specified by reference to the input iterator requirements, which is narrow-contract: it has a precondition that the iterator is dereferenceable. Yet they are marked as noexcept.

Either the noexcept (one of which was added by LWG 2637) should be removed, or the behavior of increment when given a nondereferenceable iterator should be specified.

Currently, libstdc++ and MSVC report an error via the error_code argument for a nondereferenceable directory_iterator, while libc++ and boost::filesystem assert.