[PATCH] Exploit move semantics in std::accumulate.
Paolo Carlini
pcarlini@gmail.com
Mon Jan 10 22:14:00 GMT 2011
Hi,
> std::accumulate doesn't take it's init argument by reference, so that
> doesn't apply.
> The Effects clause explicitly says the accumulation is done by "acc =
> acc + *i" which is detectable by users
Indeed. Would it make sense to provide overloads of some selected algorithms, like std::accumulate, for ranges of string::iterator? For different reasons, we are already doing something similar for std::copy and std::fill vs deque::iterator, for example.
Paolo
More information about the Libstdc++
mailing list