UDA and trait for non-GC managed pointers

Basile B. via Digitalmars-d digitalmars-d at puremagic.com
Sat Oct 15 13:23:43 PDT 2016


On Saturday, 15 October 2016 at 19:36:19 UTC, Nordlöw wrote:
> On Saturday, 15 October 2016 at 17:48:13 UTC, Basile B. wrote:
>> I agree. We are several people to do it already. I've started 
>> to during last spring (see 
>> https://forum.dlang.org/post/ficbsdfokvbvslatmomr@forum.dlang.org).
>> So far I use "@NoGc" and "@TellGcRange" added.
>
> Why does the template argument to `MustAddGcRange` default to 
> `void`?

It's probably something that I've forget to remove. Maybe it's 
been added for debugging purpose. It's clearly not needed and the 
unittests pass without.

> And why can't `MustAddGcRange` just be called any type instead 
> of just `struct`, `union` or `class`?

Because MustAddGcRange is used in "construct" which only handles 
structs, unions or classes.


More information about the Digitalmars-d mailing list