This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]