How to make a HANDLE in D without casting and stuff:
<code>
interface iface{
    void doSomething(HANDLE h);
}
class A : iface {
    override void doSomething(HANDLE h) {
        assert(validPointer(h));
        h.foo = bar;
    }
}
class B : iface {
    someVar table[];
    override void doSomething(HANDLE h) {
        assert(table.isInBounds(h));
        table[h].foo = bar;
}
</code>

Module/class -scoped alias would be great like:
<code>
#a.d
private alias uintptr_t HANDLE;

#b.d
private alias someVar HANDLE;
</code>

but alias is resolved too early for that. How to make it properly then? Union or something else?

Thanks,
Mariusz Gliwiński

Reply via email to