|
|
Nicolas Alvarez <nic### [at] gmailcom> wrote:
> std::for_each(someList.begin(), someList.end(), [&total](int x) {
> total += x
> });
I think they are also considering adding alternative versions of all
algorithms which take an iterator range. These alternative versions would
take a container and automatically apply the algorithm to all of its
elements, so you could just write:
std::for_each(someList, [&total](int x) { total += x });
--
- Warp
Post a reply to this message
|
|