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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: How to declare a generic formal type "covered" by another? Date: Fri, 02 May 2014 08:12:01 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <21e0e1f0-3fe4-4c5a-8e01-21691a0207f4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 2 May 2014 15:12:02 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="42ea65963a295dd28559459f9f96c6a5"; logging-data="4233"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PdPawNZzLWC5cxuLoufw/7LzQrBvafMI=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <21e0e1f0-3fe4-4c5a-8e01-21691a0207f4@googlegroups.com> Cancel-Lock: sha1:fPw+q48o1mZ4W5Ll2HO19YLRzto= Xref: news.eternal-september.org comp.lang.ada:19643 Date: 2014-05-02T08:12:01-07:00 List-Id: On 05/02/2014 12:58 AM, AdaMagica wrote: >> Most smart-pointer packages expose the access type; see, for example, >> >> http://www.oopweb.com/Ada/Documents/AdaLinux/Volume/18.html >> http://www.adacore.com/adaanswers/gems/gem-97-reference-counting-in-ada-part-1/ > > But exposing the access type is bad since pointes may easily outlive the object they point to. The point is not that it's good, but that it appears to be necessary to get around the kind of problems the OP is dealing with. One can create a safe-pointer package that does not expose an access type (see the PragmAda Reusable Components for an example), but the result tends to be restricted to pointers to definite, non-limited types. -- Jeff Carter "I was hobbling along, minding my own business, all of a sudden, up he comes, cures me! One minute I'm a leper with a trade, next minute my livelihood's gone! Not so much as a 'by your leave!' You're cured, mate. Bloody do-gooder!" Monty Python's Life of Brian 76