Why (on earth) does

    struct S
    {
        @disable this(this);
        int* _ptr;
    }
    pragma(msg, typeof(S.tupleof));

prints

(int*, void*)

when

    struct S
    {
        int* _ptr;
    }
    pragma(msg, typeof(S.tupleof));

prints

(int*)

?!!!

This prevents the trait `mustAddGCRangeOfStructOrUnion` [1] from detecting when a container with manual memory management doesn't have to be scanned by the GC as in, for instance,

    enum NoGc;
    struct S
    {
        @disable this(this); // disable S postlib
        @NoGc int* _ptr;
    }
static assert(!mustAddGCRangeOfStructOrUnion!S); // is false when postblit of `S` is disabled

[1] https://github.com/nordlow/phobos-next/blob/master/src/gc_traits.d#L81

Reply via email to