
On Feb 26, 2013, at 12:50 PM, Jonathan Wakely <jwakely.boost@kayari.org> wrote:
On 26 February 2013 20:36, Marshall Clow wrote:
I just realized another reason not to like this. If your prototype looks like this: template<typename InputIterator, typename OutputIterator, typename Predicate> OutputIterator copy_while ( InputIterator &first, InputIterator last, OutputIterator result, Predicate );
you can't call it like this: copy_while ( v.begin (), v.end (), out, pred );
But you could add the by-reference form as an overload, existing code passing an rvalue gets the old behaviour and doesn't get the extra information, which is OK because they never got it before now anyway.
Yes, but existing callers who were passing an lvalue get a silent change in behavior; their variable changes out from under them. -- Marshall Marshall Clow Idio Software <mailto:mclow.lists@gmail.com> A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki