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,e8fd9bf92374a60a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Declaration of private type Containers Date: Fri, 30 May 2008 14:21:52 +0200 Organization: Adalog Message-ID: <9hro1g.ni4.ln@hunter.axlog.fr> References: <6d6feee1-fe69-4d19-9745-4748d341a56e@r66g2000hsg.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1212149223 4497 195.25.228.57 (30 May 2008 12:07:03 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 30 May 2008 12:07:03 +0000 (UTC) User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) In-Reply-To: <6d6feee1-fe69-4d19-9745-4748d341a56e@r66g2000hsg.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:476 Date: 2008-05-30T14:21:52+02:00 List-Id: alexander.kleppe@web.de a �crit : > 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. Glad to hear that you accept it. The ARG tried hard to allow something like this, and eventually gave up under the pressure of an exponentially growing mountain of cans of worms... If My_Type_Lists is not used within My_Type itself, the easiest way is to instantiate it as a child package: package A.My_Type_Lists is new Ada.Containers.Doubly_Linked_List (Element_Type => My_Type); -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr