Declaring interfaces with a constructor

David Zhang via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 12 19:15:21 PDT 2017


What it says on the tin. Is there a way to create interfaces with 
a constructor or must I use an abstract class.

Additionally, is there a way to force the linker to link a 
function in a class without an implementation with another that 
does have an implementation?

i.e.

---
     //module a;
     class Foo {
         void fun();
     }

     import b: Foo;

     //module b;
     class Foo {
         void fun() { import std.stdio; writeln("!"); }
     }
---

Or something like this? Thanks.


More information about the Digitalmars-d-learn mailing list