Warp wrote:
> Nicolas Alvarez <nic### [at] gmail com> wrote:
>> for (std::vector<int>::const_iterator i = someList.begin(); i !=
>> someList.end(); ++i) {
>> total += *i;
>> }
>
> Maybe not the best of examples because with the next C++ standard you
> will also be able to do it like:
>
> for(auto i = someList.begin(); i != someList.end(); ++i)
> total += *i;
>
> which is not enormously longer than the lambda version.
Yes, when changing C++ code to C++0x, I'll have to decide which of the two
types of awesome to use.
Post a reply to this message
|