Created on 2010-02-16.00:00:00 last changed 90 months ago
Proposed resolution:
Add the declaration of iter_swap to the <iterator> header synopsis ([iterator.synopsis]), with a note that it is documented in clause [algorithms].
...
template <class T, size_t N> T* end(T (&array)[N]);
// documented in [algorithms]
template<class ForwardIterator1, class ForwardIterator2>
void iter_swap(ForwardIterator1 a, ForwardIterator2 b);
[ 2017-06-02 Issues Telecon ]
Resolve as NAD
[ 2017-02 in Kona, LEWG recommends NAD ]
[ ]
Discussed possibly moving to <utility> but don't like that. Some not seeing this as a defect, and want to keep it in <algorithm>. No one seems to feel strongly about moving to <iterator>.
The iter_swap function template appears in the <algorithm> header, yet its main use is in building further algorithms, not calling existing ones. The main clients are implementers of data structures and their iterators, so it seems most appropriate to place the template in the <iterator> header instead.
Note that this is not an issue for implementers of the standard library, as they rarely use the standard headers directly, designing a more fine-grained set of headers for their own internal use. This option is not available to customers of the standard library.
Note that we cannot remove iter_swap from <algorithm> without breaking code, but there is no reason we cannot offer the same declaration via two standard headers. Alternatively, require <algorithm> to #include <iterator>, but introducing the dependency on the iterator adaptors seems un-necessary.
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-06-05 15:41:21 | admin | set | messages: + msg9213 |
2017-06-05 15:41:21 | admin | set | messages: + msg9212 |
2017-06-05 15:41:21 | admin | set | status: lewg -> nad |
2014-11-24 15:11:58 | admin | set | status: nad future -> lewg |
2010-11-13 23:03:59 | admin | set | messages: + msg5359 |
2010-11-13 23:03:59 | admin | set | status: new -> nad future |
2010-10-21 18:28:33 | admin | set | messages: + msg1589 |
2010-02-16 00:00:00 | admin | create |