comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Ada.Containers.Doubly_Linked_Lists
Date: Sun, 04 Feb 2007 23:08:34 +0100
Date: 2007-02-04T23:08:34+01:00	[thread overview]
Message-ID: <87fy9llgnx.fsf@ludovic-brenta.org> (raw)
In-Reply-To: 45c6500f$0$22528$39db0f71@news.song.fi

Niklas Holsti <niklas.holsti@nospam.please> 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.



  reply	other threads:[~2007-02-04 22:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.69.1170624131.18371.comp.lang.ada@ada-france.org>
2007-02-04 21:35 ` Ada.Containers.Doubly_Linked_Lists Niklas Holsti
2007-02-04 22:08   ` Ludovic Brenta [this message]
2007-02-05 15:43     ` Ada.Containers.Doubly_Linked_Lists Matthew Heaney
2007-02-05  4:03 ` Ada.Containers.Doubly_Linked_Lists Jeffrey R. Carter
     [not found] <mailman.75.1170828524.18371.comp.lang.ada@ada-france.org>
2007-02-07  7:16 ` Ada.Containers.Doubly_Linked_Lists Niklas Holsti
2007-02-08 13:37 ` Ada.Containers.Doubly_Linked_Lists Stephen Leake
2007-02-07 14:52 Ada.Containers.Doubly_Linked_Lists Carroll, Andrew
2007-02-07 15:06 ` Ada.Containers.Doubly_Linked_Lists Ludovic Brenta
2007-02-07 18:22   ` Ada.Containers.Doubly_Linked_Lists Jeffrey R. Carter
2007-02-08 13:39     ` Ada.Containers.Doubly_Linked_Lists Stephen Leake
2007-02-07 18:19 ` Ada.Containers.Doubly_Linked_Lists Jeffrey R. Carter
2007-02-08 10:44   ` Ada.Containers.Doubly_Linked_Lists Alex R. Mosteo
  -- strict thread matches above, loose matches on Subject: below --
2007-02-06 14:40 Ada.Containers.Doubly_Linked_Lists Carroll, Andrew
     [not found] <mailman.67.1170570920.18371.comp.lang.ada@ada-france.org>
2007-02-04  8:10 ` Ada.Containers.Doubly_Linked_Lists Niklas Holsti
2007-02-04 21:05 ` Ada.Containers.Doubly_Linked_Lists Jeffrey R. Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox