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!feeder.eternal-september.org!gegeweb.org!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 01 May 2014 11:33:16 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How to declare a generic formal type "covered" by another? References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <536214dc$0$6715$9b4e6d93@newsspool2.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 01 May 2014 11:33:16 CEST NNTP-Posting-Host: fc627d94.newsspool2.arcor-online.net X-Trace: DXC=XNjD\\6eVm>gP]QSEBQ^d4A9EHlD;3Yc24Fo<]lROoR18kFd2bk>PCY\c7>ejV86@mYliOPa728XWj?i20077 X-Complaints-To: usenet-abuse@arcor.de Xref: news.eternal-september.org comp.lang.ada:19634 Date: 2014-05-01T11:33:16+02:00 List-Id: On 01/05/14 08:54, Natasha Kerensikova wrote: > Is it possible, or am I hitting a limit of Ada generics? For what it's worth, the generic is requesting a formal type TF, but not TS's "construction facilities". To assume, then, that the generic should be able to properly construe objects of type T seems misguided. (The in-place construction cannot incidentally "rectify" the structure of the solution, I think. The split remains.) Approaching the subject of opaque automatic memory management is ambitious, in particular if using the same approach for different kinds of type with the help of a generic: an "adequately declared" formal of Allocate is by its nature a client-side thing here, it cannot be provided by the generic, I think. Since your specific problems seem to be about the two kinds of type Storage_Element_Array and Root_Stream_Type'Class only, I wonder if you could just address these, more specifically?