Kinds of containers
Andrei Alexandrescu via Digitalmars-d
digitalmars-d at puremagic.com
Wed Oct 21 11:51:15 PDT 2015
On 10/21/2015 12:36 PM, Brad Anderson wrote:
> I don't understand why reference semantics would be implemented by the
> container themselves though. Why not a general purpose RC! (or
> RefCounted! if the current design is deemed sufficient) that can apply
> to anything, including containers?
Two reasons:
1. A generic RC wrapper cannot be made @safe (or at least I don't know how).
2. A container designed for RC can make advantageous layout decisions.
Andrei
More information about the Digitalmars-d
mailing list