From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Trying to understand Ada.Finalization.Controlled assignment mechanics. Date: Tue, 23 Sep 2014 10:50:11 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <024b1649-e056-4b7a-9072-7c7ef0c53f0b@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Tue, 23 Sep 2014 17:50:13 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="ff2e5d21b9fb0a12a9871c15f1d89f02"; logging-data="5600"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18VQt0kxq9CMYDmFybAtQ4WWFX6HyCPTwg=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 In-Reply-To: Cancel-Lock: sha1:HEgFEGhXv+qv1Te2Hjsr27blTlY= Xref: number.nntp.dca.giganews.com comp.lang.ada:189108 Date: 2014-09-23T10:50:11-07:00 List-Id: On 09/23/2014 09:08 AM, Jeremiah wrote: > > I previously thought: > A := B > Finalize(A) > copying B into A > Adjust(B) I must have misread that. Adjust is always called on the target of assignment (A in this case). As Beneschan pointed out, B could be constant. > But in reality it is closer to: > Finalize(A) > copying B into A > Adjust(A) In the case where the anonymous temporary is optimized away, this is what happens. -- Jeff Carter "All citizens will be required to change their underwear every half hour. Underwear will be worn on the outside, so we can check." Bananas 29