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: Wed, 13 Jan 2016 21:09:36 +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: 8bit 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:29118 Date: 2016-01-13T21:09:36+01:00 List-Id: On 2016-01-13 15:45, J-P. Rosen wrote: > Le 13/01/2016 09:31, Dmitry A. Kazakov a écrit : >> On 13/01/2016 01:02, Robert A Duff wrote: >>> "In place" means that the returned object created by the return >>> statement that actually returns is the same object as the one at the >>> call site. >> >> It is rather a useless definition, because it would apply to the objects >> returned by-copy as well. At some point *some* object created as a >> result of a call to the callee becomes the object of the caller. >> > OK, let's state it differently. The called function builds its result > "somewhere". That "somewhere" is what will be used by the caller as the > variable being initialized. A non-limited result is built "somewhere", just the same. I think in-place must be a definite place, not just "somewhere". > It is perfectly OK if the function starts building the result in > "somewhere_1", then decides to switch to "somewhere_2", as long as the > eventual "somewhere" is what is used by the caller, /without copy/. "Without copy" requires a definition too. IMO, it must mean that no type operations are called otherwise than on the final result (function arguments do not count). For example, Initialize must be called strictly once. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de