UDA and trait for non-GC managed pointers

ag0aep6g via Digitalmars-d digitalmars-d at puremagic.com
Sat Oct 15 10:30:02 PDT 2016


On 10/15/2016 07:19 PM, Nordlöw wrote:
> and then updating the relevant trait, such as `hasIndirections` or/and
> `hasAliasing`, to respect this attribute.

How would those traits have to updated? An indirection is an indirection 
no matter if it points to GC memory or not. Maybe we'd need a new trait.

[...]
> BTW: Should I use
>
> https://dlang.org/phobos/std_traits.html#hasIndirections
>
> or
>
> https://dlang.org/phobos/std_traits.html#hasAliasing
>
> ẁhen checking if I need to call `GC.addRange` and `GC.removeRange`?
>
> The difference is whether we should include immutable indirections or not.

As far as I see, hasIndirections. Immutable data needs to be collected, too.


More information about the Digitalmars-d mailing list