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

deadalnix deadalnix at gmail.com
Sun May 12 06:12:20 PDT 2013


On Sunday, 12 May 2013 at 13:07:15 UTC, Andrei Alexandrescu wrote:
> 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.
>

Destructive read would be super confusing and due to the Correct 
point below, don't ensure anything.

>> 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.
>


More information about the Digitalmars-d mailing list