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!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Mon, 21 Mar 2005 15:52:06 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: Subject: Re: non-library level finalization Date: Mon, 21 Mar 2005 15:54:28 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-v5wiRCJ+gKA6RmetJqMD/KZoI8rVBPCOTSy2XfiYBesKjosKQTVSkLfA/00H6NqROXxWwoWCgrsiHDG!NzNe6Ph3u8AVUC0L8Z0l8Dma3SlNzzaV+lcXuGaZu5UGeHPy8Lt5IJBMgVuMv7iY8khhuu2F/6/D X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:9698 Date: 2005-03-21T15:54:28-06:00 List-Id: wrote in message news:eIKdnT-oNJ6gvqPfRVn-pA@comcast.com... > 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? I forgot the obvious. The problem is not with a controlled *object*, but rather declaring a controlled *type*. So, you can do this by declaring a controlled type outside of the generic. Now, to make that useful, you'd have to figure out some way to figure out how to do the needed actions inside of the generic -- and *that* might prove difficult depending on what you need done. (For instance, registering a handler would work, but it too would have to be at library-level -- so you wouldn't have gained anything.) For a lot of generics, restricting to library level isn't a major concern (or, it's happened already, as is usually the case for tagged types). But your case may be different. Randy.