>But do any of them auto-capture by value?

in c++ it's optional if you want to capture-by-value or
capture-by-reference, [&]()->void{...}(); captures everything by reference
and [=]()mutable->void{...}(); captures everything by value

> I think that's still explicit

fair assessment


On Sat, 2 Jul 2022 at 05:02, Anton Smirnov <sand...@sandfox.me> wrote:

> On Fri, 2022-07-01 at 16:11 +0200, Hans Henrik Bergan wrote:
> > > As far as we are aware, only two languages in widespread use
> > > require variables to be explicitly closed over: PHP and C++. All
> > > other major languages capture implicitly, as is proposed here.
>
> But do any of them auto-capture by value?
>
> > to be fair to c++, it supports [&] to capture everything, like
> > int a=1,b=2,c=3;[&]()->void{std::cout << a << b << c;}();
>
> I think that's still explicit
>
> --
> Anton
>

Reply via email to