overriding alias symbols

Stefan Koch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 12 15:46:14 PDT 2016


On Wednesday, 12 October 2016 at 22:14:32 UTC, Superstar64 wrote:
> I'm trying to use mixin templetes to provide generic default 
> implementations.
> Something like this:
> ---
> abstract class MyAbstractClass
> {
>     void myAbstractMethod();
> }
>
> mixin template defaultImplentation(alias Method, T...)
> {
>     override void Method()
>     {
>     }
> }
>
> class MyClass : MyAbstractClass
> {
>     mixin defaultImplentation!(myAbstractMethod);
> }
> ---
> Anyone have any ideas?

override void mixin (__traits(identifier, Method)) ...  ?


More information about the Digitalmars-d-learn mailing list