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!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: container of a container... Date: Sat, 01 Aug 2015 00:48:38 +0300 Organization: Tidorum Ltd Message-ID: References: <790f92b6-56fc-4dfb-81c7-39b11a1b9ae0@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net IvgJ9PKhtwS5LboM9xqkGApC93Pv2SQ0HuG0p9dehC7MQSs5tp Cancel-Lock: sha1:NQcslNu6k1Av4cJ7tlv0tFnPewk= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <790f92b6-56fc-4dfb-81c7-39b11a1b9ae0@googlegroups.com> Xref: news.eternal-september.org comp.lang.ada:27284 Date: 2015-08-01T00:48:38+03:00 List-Id: On 15-08-01 00:13 , Hedley Rainnie wrote: > Is it possible to code that? I am coming from the C++ STL world > where, it relatively easy to put that together. (a vector of lists > as an example). > > There are many wonderful examples for Ada containers (stacks etc). > But I have not seen any container[container[...]..] examples. > > Being new to Ada, I am sure I have missed something obvious... Example of a vector of lists of characters: with Ada.Containers.Vectors; with Ada.Containers.Doubly_Linked_Lists; procedure Vec_List is package Char_Lists is new Ada.Containers.Doubly_Linked_Lists ( Element_Type => Character); package Char_List_Vectors is new Ada.Containers.Vectors ( Index_Type => Positive, Element_Type => Char_Lists.List, "=" => Char_Lists."="); Vec : Char_List_Vectors.Vector; ABC : Char_Lists.List; begin ABC.Append ('A'); ABC.Append ('B'); ABC.Append ('C'); Vec.Replace_Element (3, ABC); end Vec_List; -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .