DConf 2013 Day 1 Talk 2 (Copy and Move Semantics)

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun May 12 06:07:13 PDT 2013


On 5/12/13 5:50 AM, deadalnix wrote:
> On Sunday, 12 May 2013 at 09:10:56 UTC, Simen Kjaeraas wrote:
>> On 2013-05-12, 08:12, deadalnix wrote:
>>
>>> On Saturday, 11 May 2013 at 22:24:38 UTC, Simen Kjaeraas wrote:
>>>> I'm not convinced. unique, like const or immutable, is transitive.
>>>> If foo
>>>> is unique, then so is foo.bar.
>>>>
>>>
>>> That isn't true. Please read microsoft's paper.
>>
>> Done. *Mostly* transitive, then. Anything reachable through a unique
>> reference is either unique or immutable.
>
> No.
>
> Think about it : when you reach something via a uniq pointer, it is by
> definition not unique as you have 2 copies of it, because you just
> accessed it.

I don't think so. Lent and destructive read can be used.

> Plus the unique pointer refers to a unique mutable graph of object. A
> object into that graph can have several object into the graph refereing
> to it.

Correct.


Andrei


More information about the Digitalmars-d mailing list