Created on 2009-03-22.00:00:00 last changed 172 months ago
Proposed resolution:
Change in [algorithms.syn] and [alg.replace]:
template<ForwardIterator Iter, class T> requiresOutputIterator<Iter, Iter::reference> &&OutputIterator<Iter, const T&> && HasEqualTo<Iter::value_type, T> void replace(Iter first, Iter last, const T& old_value, const T& new_value); template<ForwardIterator Iter, Predicate<auto, Iter::value_type> Pred, class T> requiresOutputIterator<Iter, Iter::reference> &&OutputIterator<Iter, const T&> && CopyConstructible<Pred> void replace_if(Iter first, Iter last, Pred pred, const T& new_value);
[ Summit: ]
We agree. To be handled by Howard.
Addresses UK 301 [CD1]
replace and replace_if have the requirement: OutputIterator<Iter, Iter::reference> Which implies they need to copy some values in the range the algorithm is iterating over. This is not however the case, the only thing that happens is const T&s might be copied over existing elements (hence the OutputIterator<Iter, const T&>.
Remove OutputIterator<Iter, Iter::reference> from replace and replace_if.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg648 |
2010-10-21 18:28:33 | admin | set | messages: + msg647 |
2009-03-22 00:00:00 | admin | create |