This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] Exploit move semantics in std::accumulate.
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