Is there any way to declare template functions inside interface and then override them in a class? Trying to compile the following code results in "undefined reference" error:

import std.stdio;

interface MyInterface
{
    T doAndReturnSomething(T)(T param);
}

class MyClass : MyInterface
{
    override T doAndReturnSomething(T)(T param)
    {
        return param;
    }
}

void main()
{
    MyInterface myClass = new MyClass();
    writeln(myClass.doAndReturnSomething!(string)("Hello"));
}

Thanks in advance!

Reply via email to