automatic mixin in classes

deadalnix deadalnix at gmail.com
Mon Nov 5 06:38:46 PST 2012


Le 27/10/2012 07:39, Gor Gyolchanyan a écrit :
> I've stumbled upon this numerous times and I wish I could automate this
> somehow.
> The idea is to have some mixin templates mixed into classes
> automatically when they inherit from some base class.
> For instance, advanced RTTI methods, which analyze the enclosing class
> at compile-time.
> Unfortunately, AFAIK, there's no way of doing it automatically and one
> needs to both derive from a certain class and mix in a certain mixin
> template manually.
> Is there a way to avoid the boilerplate and have it done automatically?
>
> --
> Bye,
> Gor Gyolchanyan.

I had this need several time too. But I don't think this should be a 
functionality added in D at this point.

This is typically AOP stuff and it is much more interesting for D to 
think about how to integrate the whole AOP concept instead of hacking 
around each use case.


More information about the Digitalmars-d mailing list