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,ba2aaa9cb4d25085 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.scarlet.biz!news.scarlet.biz.POSTED!not-for-mail NNTP-Posting-Date: Sun, 04 Feb 2007 16:08:37 -0600 From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Ada.Containers.Doubly_Linked_Lists References: <45c6500f$0$22528$39db0f71@news.song.fi> Date: Sun, 04 Feb 2007 23:08:34 +0100 Message-ID: <87fy9llgnx.fsf@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:OuafYY7FAeEm9TyPrjfSHd3jTrA= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: 62.235.232.27 X-Trace: sv3-S2wDz0dFoEOqqeHtYIEsY0qI97oSWSVAC8otYgj832XI8JQnaM83x+8NCs+M+ieedgmREZcuBeIRHve!HXp2/bwja2vUcZA6Ggupoz7IEXgI+j1JvBzs1QiXUvwn0lcOhcVSiLExPoazrVubgIn5RlWT3A== X-Complaints-To: abuse@scarlet.be X-DMCA-Complaints-To: abuse@scarlet.biz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:8938 Date: 2007-02-04T23:08:34+01:00 List-Id: Niklas Holsti writes: > Carroll, Andrew wrote: >> Ahhhhh, I see. > > (Please quote a bit of the post to which you are replying so that the > context of your "Ahhhhh" is clearer :-) > >> Okay, so, just out of curiosity, what do I do if I need the >> Node_type within Ada.Containers.Doubly_Linked_Lists to >> have an additional "attribute"? > > What Node_Type? Are you peeking at the *private* part of > Ada.Containers.Doubly_Linked_Lists, or even at the source-code of the > body of the generic? That's useless because you can't access the > private stuff or the stuff in the body. > > Whatever you want to keep in your list, put it in your Element_Type, > the type that you use to instantiate Doubly_Linked_Lists. For example, > make it a record type and put in whatever components you need. And, if Niklas' answer was unclear, do not add Prev or Next to your Element_Type; it is the generic linked list's job to add and manage them. If all you want is an unbounded string, just say package Lists_Of_Unbouned_Strings is new Ada.Containers.Doubly_Linked_Lists (Element_Type => Ada.Strings.Unbounded.Unbounded_Strings); L : Lists_Of_Unbouned_Strings.List; and off you go. -- Ludovic Brenta.