Created on 2010-08-25.00:00:00 last changed 91 months ago
Rationale:
No consensus to make this change at this time.
[ 2017-06-02 Issues Telecon ]
P0022 is exploring a resolution. We consider this to be fairly important issue
Move to Open, set priority to 3
[ 2017-02 in Kona, LEWG recommends NAD ]
D0022 Proxy Iterators for the Ranges Extensions - as much a fix as we’re going to get for vector<bool>.
[ 2010-11 Batavia: ]
Closed as NAD Future, because the current iterator categories cannot correctly describe vector<bool>::iterator. But saying that they are Random Access Iterators is also incorrect, because it is not too hard to create a corresponding test that fails. We should deal with the more general proxy iterator problem in the future, and see no benefit to take a partial workaround specific to vector<bool> now.
[ Old Proposed Resolution: ]
Insert a new paragraph into [vector.bool] between p4 and p5:
[Note All functions in the library that take a pair of iterators to denote a range shall treat vector<bool> iterators as-if they were random access iterators, even though the reference type is not a true reference.-- end note]
[ Post-Rapperswil Alisdair provides wording ]
Initial wording is supplied, deliberately using Note in preference to Remark although the author notes his preference for Remark. The issue of whether iterator_traits<vector<bool>>::iterator_category is permitted to report random_access_iterator_tag or must report input_iterator_tag is not addressed.
[ Rapperswil Review ]
The consensus at Rapperswil is that it is too late for full support for proxy iterators, but requiring the library to respect vector<bool> iterators as-if they were random access would be preferable to flagging this container as deliberately incompatible with standard library algorithms.
Alisdair to write the note, which may become normative Remark depending on the preferences of the project editor.
[ Resolution proposed in ballot comment ]
Either revise the iterator requirements to support proxy iterators (restoring functionality that was lost when the Concept facility was removed) or add an extra paragraph to the vector<bool> specification requiring the library to treat vector<bool> iterators as-if they were random access iterators, despite having the wrong reference type.
Addresses GB-118
vector<bool> iterators are not random access iterators because their reference type is a special class, and not bool &. All standard libary operations taking iterators should treat this iterator as if it was a random access iterator, rather than a simple input iterator.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-06-05 15:41:21 | admin | set | messages: + msg9215 |
2017-06-05 15:41:21 | admin | set | messages: + msg9214 |
2017-06-05 15:41:21 | admin | set | status: lewg -> open |
2014-11-24 15:11:58 | admin | set | status: nad future -> lewg |
2011-03-05 21:44:45 | admin | set | messages: + msg5612 |
2011-03-05 21:44:45 | admin | set | messages: + msg5611 |
2011-03-05 21:44:45 | admin | set | messages: + msg5610 |
2011-03-05 21:44:45 | admin | set | messages: + msg5609 |
2011-03-05 21:44:45 | admin | set | messages: + msg5608 |
2011-03-05 21:44:45 | admin | set | messages: + msg5607 |
2011-03-05 21:44:45 | admin | set | status: open -> nad future |
2010-10-24 03:04:13 | admin | set | messages: + msg4919 |
2010-08-25 00:00:00 | admin | create |