Request: traits isImplemented
JS
js.mdnq at gmail.com
Fri Jul 5 02:52:31 PDT 2013
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. A sort of
default proxy, wrapper, or composite pattern implementer. It
reduces boilerplate code significantly.
Unfortunately allMembers returns methods that are not actually
implemented or part of the class.
Something like allImmediateMembers would be useful where it only
returns the actually explicit members of the immediate
class/struct that it is used on and accomplish the same task.
More information about the Digitalmars-d
mailing list