Better handling of noncopyable objects and objects with this(this)

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 1 10:38:39 PDT 2015


On 06/01/2015 07:30 PM, Andrei Alexandrescu wrote:
> On 6/1/15 9:40 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>"
> wrote:
>> The question is not what should happen when someone does a conditional
>> _explicit_ move, but whether a move should be done _implicitly_ by the
>> compiler given the above constellation, and how it deals with the
>> destructor if yes.
>
> At language level the compiler has control over generating the
> destructor, so it won't if it's doing a move. Note that this is STATIC
> analysis. -- Andrei

Static analysis is perfectly capable of figuring this case out. He is 
asking about how much sophistication will be guaranteed by the language 
specification, and what the exact rules are.


More information about the Digitalmars-d mailing list