Kinds of containers

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 21 12:44:47 PDT 2015


On Wednesday, 21 October 2015 at 19:16:28 UTC, Andrei 
Alexandrescu wrote:
> Sometimes you want a value container as a member of a struct 
> which in turn is a value type.

Sure, but at least in theory, the struct's postblit should be 
able to copy a reference type container via dup or whatnot if 
that's what you really want (though the issues with const and 
immutable interacting badly with postblit remain), and creating a 
whole set of value type variants of containers just for cases 
like that (which are sometimes useful but usually a bad idea) 
seems like overkill.

- Jonathan M Davis


More information about the Digitalmars-d mailing list