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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Why is the destructor called multiple times after I declare an object? Date: Mon, 11 Jan 2016 22:10:49 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <293c58ac-4ebd-488a-abcc-b6e88811eec8@googlegroups.com> <871t9ogevj.fsf@theworld.com> NNTP-Posting-Host: LNA1TkTuMxfwTHzeJdi6nA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:29092 Date: 2016-01-11T22:10:49+01:00 List-Id: On 2016-01-11 19:17, Bob Duff wrote: > Brian Drummond writes: > >> Somehow I expected "extended return" to allocate space and "build in >> place" during the execution of the return statement. > > Build-in-place is done for return of immutably-limited types, > whether or not the extended return syntax is used. But you can leave one return statement on an exception, catch the exception, and then return through another return statement, with other discriminants and even other type of the result (if it is class-wide). Therefore the result can be potentially allocated and reallocated any number of times. In which sense is this behavior 'in-place'? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de