Idea for avoiding GC for lambdas

Ola Fosheim Grostad ola.fosheim.grostad at gmail.com
Tue Jun 22 05:57:25 UTC 2021


On Monday, 21 June 2021 at 20:01:27 UTC, Steven Schveighoffer 
wrote:
> The compiler would see there's a lambda involved, automatically 
> pass the context parameter `someval` into the function itself, 
> and everything magically works. It would only be used when a 
> closure would otherwise be allocated, and the function being 
> called declares the context parameter.
>
> Disclaimer: I am not a language developer.
>
> Does this make sense? Is there anything feasible that might be 
> similar? Would it be more feasible with different syntax?

You are asking for C++ lambdas? No need for a new type of 
template parameter.



More information about the Digitalmars-d mailing list