Is there a way to do something like this while keeping the destructor nogc?

class Foo {
    shared static Foo[id] registry;
    int id;
    this(int id) {
        this.id = id(
        registry[id] = this;
    }
    ~this() }. // ideally should be tagged as @nogc
         // nasty, memory corruption due to gc
        registry.remove(id)f;
        // however compiler doesn't warn about it...
    }
}

Reply via email to