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,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada References: <41547dae$0$91007$39cecf19@news.twtelecom.net> <1g2d9xmnita9f.5ecju0eftkqw$.dlg@40tude.net> <87u4rkhddelw$.1uuoqhfyd2eay$.dlg@40tude.net> Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Wed, 29 Sep 2004 11:44:41 -0400 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: <415ad5be$0$74190$39cecf19@news.twtelecom.net> Organization: Time-Warner Telecom NNTP-Posting-Date: 29 Sep 2004 15:33:18 GMT NNTP-Posting-Host: fc3510de.news.twtelecom.net X-Trace: DXC=F?n^;YhbS[\NEg=@eQK2QZC_A=>8kQj6]MOj3YM9`=aX>Nf`US;7g=ZdYZAA8S: "Robert Kawulak" wrote in message news:cje1hj$jkh$1@nemesis.news.tpi.pl... > > I don't know about Ada, but in C++ you can, and such "templates nesting" > is even the recommended way to have multi-dimensional vectors: > > typedef vector< vector < vector > > vector_int_3D; Typically, you'd use a 3-dimensional array: type Array_Type is array (Positive range <>, Positive range <>, Positive range <>) of Integer; Of course, you can pass the type made available via an instantiation of a generic package as the actual type of some other instantiation. The container libraray for Ada 2005 (see AI-302) was specially designed to allow a container as the element of another container. So you could say: package IV is new Ada.Containers.Vectors (Positive, Integer); package IVV is new A.C.V (Positive, IV.Vector); package IVVV is new A.C.V (Positive, IVV.Vector); You'd probably want to declare a local wrapper function to give you a nice syntax for selecting an element: V : IVVV.Vector; function E (I, J, K : Positive) return Integer is ...; begin N := E (1, 2, 3);