
25 Nov
2008
25 Nov
'08
4:20 a.m.
AMDG Tomas Puverle wrote:
The default-constructed state of a string class is a perfectly valid state, that's totally unrelated.
My point was that a default constructed range may be in a perfectly valid state, too, depending on its iterators.
Indeed. I think that a default constructed iterator_range should be usable and empty iff default constructed iterators are non-singular and equal. This effectively pushes dealing with default construction onto the iterators. IMO, this is more consistent than the old behavior, where a default constructed iterator_range was "empty", but r.begin() == r.end() could be undefined behavior. In Christ, Steven Watanabe