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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f5508b044317ceed X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!out01a.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!in03.usenetserver.com!news.usenetserver.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Date: Thu, 07 Feb 2008 22:46:57 -0500 From: "Peter C. Chapin" User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Question about controlled types. References: <47aa5ca6$0$32487$4d3efbfe@news.sover.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <47abd0b0$0$32511$4d3efbfe@news.sover.net> Organization: SoVerNet (sover.net) NNTP-Posting-Host: 85feb0c6.news.sover.net X-Trace: DXC=5GDe2dc=K8MP7I;=`^Ef6@K6_LM2JZB_C\M@V[W]Q2XJ3?@`i3kGa5K=3PbWGhJRI@ Adam Beneschan wrote: > Did you read the rest of the paragraph? "As explained below, the > implementation may eliminate the intermediate anonymous object, so > this description subsumes the one given in 5.2, 'Assignment > Statements'". Well the anonymous object, and its existence or lack thereof, is not what I'm worried about... I admit my earlier post may have been unclear on that point. My main concern was in how to use controlled types in an "exception safe" way. However, it occurred to me today that if the implementation supports garbage collection my example would work fine. In that case Finalize wouldn't have to do anything. Adjust would still make a copy, but if creating that copied failed during the assignment to A (the final target), it would still be okay to share heap structures with the anonymous object. When the anonymous object vanished those structures would just be owned by A and not become garbage as they would have otherwise. Anyway, thanks for your detailed reply! Peter