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,589d16556c145528 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!zen.net.uk!dedekind.zen.co.uk!news-peer-lilac.gradwell.net!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada References: Subject: Re: non-library level finalization Date: Mon, 21 Mar 2005 09:01:30 -0000 Organization: BAE SYSTEMS X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Message-ID: <423e8bb1$1_1@glkas0286.greenlnk.net> X-Original-NNTP-Posting-Host: glkas0286.greenlnk.net NNTP-Posting-Date: 21 Mar 2005 09:01:49 GMT NNTP-Posting-Host: 20.133.0.1 X-Trace: 1111395709 news.gradwell.net 38039 dnews/20.133.0.1 X-Complaints-To: news-abuse@gradwell.net Xref: g2news1.google.com comp.lang.ada:9663 Date: 2005-03-21T09:01:49+00:00 List-Id: tmoran@acm.org wrote: > I have a generic package that would benefit from doing some cleanup > when an instantiation disappears. It can't just declare a (private) > Finalization_Controlled object because that would require all > instantiations to be at library level. Suggestions? Other than waiting for Ada2005... ...could you wrap it in some sort of Unbounded_String - isn't there some sort of compiler 'magic' required to ensure that there is effectively some sort of GC for this type? (RM A.4.5 "No storage associated with an Unbounded_String object shall be lost upon assignment or scope exit."). Not sure how you'd get this to work (I'm barely awake yet!) but just a thought... Cheers -- Martin