Can we fix this?

deadalnix deadalnix at gmail.com
Thu Sep 30 13:55:53 UTC 2021


On Thursday, 30 September 2021 at 11:36:01 UTC, bauss wrote:
> On Thursday, 30 September 2021 at 11:32:28 UTC, Sebastiaan 
> Koppe wrote:
>> On Thursday, 30 September 2021 at 11:00:15 UTC, deadalnix 
>> wrote:
>>> D either needs to ditch constructor, destruction, immutable, 
>>> and anything that has to do with lifetime.
>>
>> I rather have closures that require you to state what you 
>> capture.
>
> I really like that in C++ because you don't clutter memory with 
> unnecessary references. Your closure will only reference what 
> you capture.

I have good news for you: the compiler knows what you capture and 
what you don't, so the only case where in which you'll have 
unnecessary reference, is if you capture explicitly and mess it 
up.


More information about the Digitalmars-d mailing list