Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c++
Subject: Re: thread about the pros and cons of lambdas, but more about cons
Date: Sat, 28 Sep 2024 04:25:42 -0700
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <86o7483tqh.fsf@linuxsc.com>
References: <20240925195423.00007ecc@yahoo.com> <86ploq5dhm.fsf@linuxsc.com> <20240927161541.000036d8@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sat, 28 Sep 2024 13:25:42 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8f5b490802ead3c9705b43cb022c8c76"; logging-data="1286855"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/1VRDSrTqBXvNPF3B/iaqwGRBZRW7j+/0="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:YYhUfINU73XgqRoBb93KANXuJC4= sha1:5GiZdNsDgJMi8boKhsX47Eoj9cM=
Xref: csiph.com comp.lang.c++:120431
Michael S writes:
> On Thu, 26 Sep 2024 14:09:09 -0700
> Tim Rentsch wrote:
>
[...]
>> Getting back to lambdas, I would say that there are two primary
>> uses for lambdas. One use is as a convenience function, local to
>> an outer function definition, where some small-scale processing
>> step is encapsulated rather than being replicated. The second use
>> is as a call-back function given as an argument to some outside
>> function, where there is state that the outside function doesn't
>> know about. The same kind of reasoning applies to member functions
>> in structs defined locally in the outer function. Neither of those
>> scenarios applies in the earlier example functions.
>
> I don't disagree in theory. Practice is something else.
Could I ask you to expand on that answer? I'm not sure what
it is you're agreeing with (or not disagreeing with), and
also not sure what the reasons are for not agreeing.
I confess to being completely lost about what you're
getting at with the practice/theory distinction here.