Let's get the semantic around closure fixed.

deadalnix deadalnix at gmail.com
Thu May 20 13:48:01 UTC 2021


On Thursday, 20 May 2021 at 13:12:30 UTC, Ola Fosheim Grostad 
wrote:
> On Thursday, 20 May 2021 at 12:53:08 UTC, deadalnix wrote:
>> You can do this with functors.
>
> Yes, but the point is to declare a delegate with internal 
> closure buffer without knowing what it receives?

It is more tricky, but some implementation of std::function do 
that. If what's captured is small enough, they store it in place, 
if it is larger, they allocate.

It is not mandated by the standard and the size after which 
they'll allocate is implementation defined when they do, not 
under the user's control.


More information about the Digitalmars-d mailing list