Request: traits isImplemented

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Jul 5 08:16:55 PDT 2013


On 7/5/13, JS <js.mdnq at gmail.com> wrote:
> I have a request to add to __traits to check if a method/property
> of a class/struct is actually implemented or not.
>
> interface A { void myfunc(); }
>
> class B : A { } // myfunc not implemented
> class C : A { void myfunc() { ... } // myfunc implemented
>
> This may seem odd but I need it for conditional mixin compilation
> to add in the methods when they are not implemented.

Perhaps looking at the BlackHole or WhiteHole implementation can help
you out to implement this via a template? They're in std.typecons.


More information about the Digitalmars-d mailing list