Looking for documentation of D's lower-level aspects.

Sean Silva chisophugis at gmail.com
Sat Oct 22 20:25:48 PDT 2011


== Quote from Jonathan M Davis (jmdavisProg at gmx.com)'s article
> On Sunday, October 23, 2011 00:01:42 Sean Silva wrote:
> They're all supposed to be reference types.

What prompted the decision for that? Doesn't that incur an extra heap allocation for the
containers, and an extra level of indirection? I mean, with value-semantics like STL
containers, you can use it like a value, e.g. as a local in a function, and have no overhead,
but if you want to wrap a class around it and have it by reference, then you can, and it is no
less efficient than if the containers were written that way. But if the containers are already
by reference, you can't return them to having value semantics without adding even more
indirection and inefficiency.


More information about the Digitalmars-d-learn mailing list