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!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Incomplete types used with generics Date: Tue, 12 May 2015 16:49:16 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <830c0323-a06c-4884-9214-89f3ee6f17b5@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1431467357 1378 24.196.82.226 (12 May 2015 21:49:17 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 12 May 2015 21:49:17 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:25851 Date: 2015-05-12T16:49:16-05:00 List-Id: "Jeremiah" wrote in message news:830c0323-a06c-4884-9214-89f3ee6f17b5@googlegroups.com... ... > I *think* the generic parameter "type Item_Type is tagged limited > private;" is considered incomplete as is "type Node2_Type is tagged;". On the the things that *I* missed is the above. No, private types aren't incomplete, and in fact even a private type cannot be used as the actual to a generic private type (the type is immediately frozen, but for a private type that is illegal, as per 13.14(17)). If you want an incomplete formal parameter, you have to write it that way. That is: type Item_Type is tagged; On the other side, *anything* can be the actual to a generic formal incomplete type. The type can be limited, incomplete, private, and/or abstract. Of course, that means there isn't much you can do with such a type (you'd have to pass in an allocator and deallocator subprogram, for instance). There's somewhat more you can do with a tagged incomplete type (in particular, you can make calls), but even that is very limiting. But of course that's the idea; if you can live with the limitations, you get the ability to instantiation the generic almost anywhere with any kind of type. >> What am I missing? That you didn't use an incomplete formal type, so OF COURSE the compiler rejected your instantiation with an incomplete type. Sorry about missing that yesterday; I was so excited that someone would actually try to use an incomplete formal that I failed to notice that you didn't actually do so. One does not think clearly when you are gloating. :-) Randy.