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,2ce943dcc1eb3f9c X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-out.readnews.com!news-xxxfer.readnews.com!not-for-mail Date: Sun, 09 Jul 2006 12:21:25 -0400 From: "Peter C. Chapin" User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to properly clean up an extended, generic structure? References: <44b107b7$0$3629$4d3efbfe@news.sover.net> <87wtamalvc.fsf@ludovic-brenta.org> In-Reply-To: <87wtamalvc.fsf@ludovic-brenta.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <44b12d01$0$3650$4d3efbfe@news.sover.net> Organization: SoVerNet (sover.net) NNTP-Posting-Host: 5d444c83.news.sover.net X-Trace: DXC=?SP5E:o<=OCSHGN<7KP`INK6_LM2JZB_CjLSO5T>Yd?H:WUUlR<856OVKC0OUh9GXA6em^;EKia;@ X-Complaints-To: abuse@sover.net Xref: g2news2.google.com comp.lang.ada:5580 Date: 2006-07-09T12:21:25-04:00 List-Id: Ludovic Brenta wrote: > You do not need to change anything to your Splay_Tree; instead, just > pass a controlled type as the Item_Type. A controlled type is a type > derived from Ada.Finalization.Controlled(*). You override its > Finalize procedure to reclaim the storage for the item; that's the > equivalent of a destructor in C++. The language guarantees (ARM > 7.6(1)) that the instance of Unchecked_Deallocation will call your > Finalize, much like delete in C++ will call your destructor. That sounds good... much better than what I was thinking about before. I'll play with it. Thank you (and others) for bringing this to my attention. Peter