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,97a4ff0c3103bbb6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!newscon06.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Deallocating list of polymorphic objects? Date: Thu, 30 Nov 2006 19:05:07 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1164930027.758923.119740@h54g2000cwb.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1164931507 12230 192.74.137.71 (1 Dec 2006 00:05:07 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 1 Dec 2006 00:05:07 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:nV1H40hoZNlwujncXfCgA00JXpY= Xref: g2news2.google.com comp.lang.ada:7763 Date: 2006-11-30T19:05:07-05:00 List-Id: "Michael Rohan" writes: > Since I want the deallocation to be dispatching, it needs to take an > access parameter which is then converted to a pointer for the object > being deallocated, e.g., an Integer_Pointer, and then passed to an > Unchecked_Deallocation procedure. You don't need to do all that by hand. It's OK to pass access-to-classwide to Unchecked_Deallocation. It will do the necessary dispatching internally. But, to be safe, you should ensure that the result type of each "new" is the same as the type passed to Unchecked_Deallocation. - Bob