Difference between stack-allocated class and struct

Piotr Szturmaj bncrbme at jadamspam.pl
Mon May 2 15:33:06 PDT 2011


Mariusz Gliwiński wrote:
> I'll clarify myself:
> All i would need is extending - without polymorphism.
> Containment, can be solution for fields which doesn't annoys so much
> (although image in auto-generated documentation, just like it's with
> subclassing, would be nice).
> Unfortunately, the worse case is about methods, which have to be
> manually forwarded to contained struct.
>
> So, does someone sees any nice solution for method forwarding as
> described? Should i make use of some mixin's?

You can use 'alias this':

http://www.digitalmars.com/d/2.0/class.html#AliasThis


More information about the Digitalmars-d-learn mailing list