I think this should work:

[code]
import std.stdio;

class Foo(T) {
public:
        T Num;
        
        @property
        Foo!(U) ConvertTo(U)() inout {
                return cast(Foo!(U)) this;
        }
        
        alias ConvertTo this;
}

void Call(const Foo!(float) FFoo) {

}

void main() {
        Foo!(ubyte) UbFoo = new Foo!(ubyte)();
        
        Call(UbFoo);
        
        readln();
}
[/code]

Why it doesn't?

Reply via email to