有没有办法abstract auto在D中有功能?
如果我按如下方式声明一个类:
class MyClass
{
abstract auto foo();
}
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
main.d(12): Error: function declaration without return type. (Note that constructors are always named 'this')
main.d(12): Error: no identifier for declarator foo()
Run Code Online (Sandbox Code Playgroud)
我想知道为什么这是不可能的?有没有其他方法可以获得类似的功能?
d ×1