|
|
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> Warp wrote:
>>> std::for_each(someList, [&total](int x) { total += x });
>
>> And, really, what's the advantage of this over a normal for loop?
>
> Nothing. Since it's C++ code, it sucks.
You know, if you're not mature enough to have a civil conversation, you
don't really need to participate. I asked an actual useful question, so I
could perhaps learn why people are working to put lambdas into the language
when they have restrictions that make them useless for what most other
people use lambdas for. If your only answer is "there's no advantage of
lambdas over coding a regular for loop", then yeah, C++ sucks.
However, if there's anyone else who might like to answer that question, and
offer a scenario where such a structure is useful for something other than
marketing that "oh yea, we have a functional language too", feel free to
follow up.
--
Darren New, San Diego CA, USA (PST)
My fortune cookie said, "You will soon be
unable to read this, even at arm's length."
Post a reply to this message
|
|