Date
2018-05-23.00:00:00
Message id
9665

Content

[ 2018-05-23: Casey restores the intended design with an expansion of the original PR ]

The intended design is that all copies of a single recursive_directory_iterator share a common block of state which includes the values returned by options, depth, and recursion_pending - hence the mandate that those functions not be called on a non-dereferenceable iterator in [fs.class.rec.dir.itr] para 2. To allow an implementation with such shared state, it's necessary to make changes to the value returned by recursion_pending() visible to all copies of the same dereferenceable iterator.

Also:

  • pop notionally calls increment repeatedly until the current directory is exhausted, pop should affect the value of recursion_pending similarly to increment.

  • options is not valid for all constructor signatures described by [fs.rec.dir.itr.members] para 2.

  • the copies and moves don't specify what they actually do

  • it's not quite kosher for the copies and moves to have postconditions on the value of expressions that have UB if the iterator copied/moved from is not dereferenceable.