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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e8fd9bf92374a60a,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!r66g2000hsg.googlegroups.com!not-for-mail From: alexander.kleppe@web.de Newsgroups: comp.lang.ada Subject: Declaration of private type Containers Date: Fri, 30 May 2008 04:49:41 -0700 (PDT) Organization: http://groups.google.com Message-ID: <6d6feee1-fe69-4d19-9745-4748d341a56e@r66g2000hsg.googlegroups.com> NNTP-Posting-Host: 141.54.159.220 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1212148181 31093 127.0.0.1 (30 May 2008 11:49:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 30 May 2008 11:49:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r66g2000hsg.googlegroups.com; posting-host=141.54.159.220; posting-account=LGR_CwoAAAA-5VQ2IOOBlJKOPyfqw14F User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:473 Date: 2008-05-30T04:49:41-07:00 List-Id: Hi all, I'm relatively new to Ada. I have a problem, which seems pretty basic to me. Thus, I guess you guys have a easy solution ready. The only thing I want to do is to declare a list package, whose Element_Type is of a private record type: package A is type My_Type is private package My_Type_Lists is new Ada.Containers.Doubly_Linked_List (Element_Type => My_Type); private type My_Type is record ... end record; end A; GNAT compiler says, this is a "premature use of private type", which I accept. However, I don't wanna declare the My_Type_Lists package elsewhere, which would be a possible solution. Ideally I wanna use it in some other Package or subprogram like this: package B is type Rec_Type is private package My_Type_Lists is new Ada.Containers.Doubly_Linked_List (Element_Type => A.My_Type); -- would be possible, but not very nice private type Rec_Type is record A_List : A.My_Type_Lists.List; end record; So what is the correct way to declare the Container package in package A? Thanks in advance, Alex