Any plans to support STL value types?

lobo via Digitalmars-d digitalmars-d at puremagic.com
Sat May 16 16:03:30 PDT 2015


On Saturday, 16 May 2015 at 12:22:00 UTC, QAston wrote:
> On Saturday, 16 May 2015 at 09:20:37 UTC, Kagamin wrote:
>> Currently D frontend can't use such idiom: it has classes, 
>> which support inheritance, but are reference types, it also 
>> has structs, which don't support inheritance and are value 
>> types, and they don't mix.
>
> In this case inheritance is just a code/structure sharing tool. 
> D has mixins and alias this to do that.

This is what I currently use now for composition of structs where 
I'd consider using private inheritance in C++. The semantics are 
not identical of course, e.g. construction and initialization 
differ for one, but it works very well in my situation.

bye,
lobo


More information about the Digitalmars-d mailing list