Warn about using the GC

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sun Jan 14 12:47:47 UTC 2024


On 15/01/2024 1:43 AM, claptrap wrote:
> On Sunday, 14 January 2024 at 12:29:26 UTC, Richard (Rikki) Andrew 
> Cattermole wrote:
>> On 15/01/2024 1:21 AM, claptrap wrote:
>>> Nobody who uses @nogc is complaining about it. The people who are 
>>> complaining are people who don't use it, they are complaining because 
>>> it puts extra burden on them to support it. Or it's causing 
>>> fragmentation. (Thats my impression anyway)
>>
>> I have over 100k LOC annotated with ``@nogc``. That is also -betterC.
>>
>> I am complaining.
>>
>> I also want contract invalidation to help make the transition for 
>> callbacks much more seemless to remove the perceived fragmentation.
> 
> I actually dont know what that means.


```d
void func(void delegate() @nogc del) @nogc;
```

Basically if you pass in a delegate that does not have ``@nogc``, the 
``@nogc`` on the function gets removed.

The function body will of course be typed checked as if it did have 
``@nogc``.

I want this to be the default, although Timon wants it to be much more 
configurable so you can pick and choose per parameter (again not 
mutually exclusive things!).

This makes it so things like ``opApply``, only need one overload, not 
say 24 of them to handle all the different combinations of attributes.


More information about the Digitalmars-d mailing list