[path.itr] requires path::iterator to be a BidirectionalIterator, which also implies the ForwardIterator requirement in [forward.iterators] p6 , so the following assertion should pass:
path p("/");
auto it1 = p.begin();
auto it2 = p.begin();
assert( &*it1 == &*it2 );
This prevents iterators containing a path, or constructing one on the fly when dereferenced, the object they point to must exist outside the iterators and potentially outlive them. The only practical way to meet the requirement is for p to hold a container of child path objects so the iterators can refer to those children. This makes a path object much larger than would naïvely be expected.
The Boost and MSVC implementations of Filesystem fail to meet this requirement. The GCC implementation meets it, but it makes sizeof(path) == 64 (for 64-bit) or sizeof(path) == 40 for 32-bit, and makes many path operations more expensive.
[path.itr] requires
path::iterator
to be a BidirectionalIterator, which also implies the ForwardIterator requirement in [forward.iterators] p6 , so the following assertion should pass:This prevents iterators containing a
path
, or constructing one on the fly when dereferenced, the object they point to must exist outside the iterators and potentially outlive them. The only practical way to meet the requirement is forp
to hold a container of childpath
objects so the iterators can refer to those children. This makes apath
object much larger than would naïvely be expected.The Boost and MSVC implementations of Filesystem fail to meet this requirement. The GCC implementation meets it, but it makes
sizeof(path) == 64
(for 64-bit) orsizeof(path) == 40
for 32-bit, and makes many path operations more expensive.