C++ Logo

std-proposals

Advanced search

Re: [std-proposals] sizeof lambda in an unevaluated context

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Wed, 26 Jun 2024 00:29:14 +0100
On Tue, Jun 25, 2024 at 3:14 PM Thiago Macieira wrote:
>
> The first lambda captures 9 integers by value, the second captures 9
> pointers.


Both lambdas capture 9 integers by reference.

First one: sizeof([&args...](){})

Second one: sizeof([&a,&b,&c,&d,&e,&f,&g,&h,&i](){})

There ain't no capturing of pointers taking place (unless you're
alluding to how compilers implement capture-by-reference by capturing
memory addresses by value???)

Received on 2024-06-25 23:29:27