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,9ce5fb49dc74582f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!e3g2000cwe.googlegroups.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: generic question Date: 20 Nov 2006 13:40:50 -0800 Organization: http://groups.google.com Message-ID: <1164058850.393219.289520@e3g2000cwe.googlegroups.com> References: <1163959439.299036.129940@e3g2000cwe.googlegroups.com> <87mz6nnt4v.fsf@ludovic-brenta.org> <20061119202320.19149a2f@cube.tz.axivion.com> <4560D5BE.5060508@obry.net> <4sdejbFuovi3U1@mid.individual.net> <4561DFF8.5000904@obry.net> <4se99nFv3ba7U1@mid.individual.net> <1164057381.185544.143140@h54g2000cwb.googlegroups.com> NNTP-Posting-Host: 66.162.65.129 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1164058856 20173 127.0.0.1 (20 Nov 2006 21:40:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 20 Nov 2006 21:40:56 +0000 (UTC) In-Reply-To: <1164057381.185544.143140@h54g2000cwb.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.8) Gecko/20061025 Firefox/1.5.0.8,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: e3g2000cwe.googlegroups.com; posting-host=66.162.65.129; posting-account=Zl1UPAwAAADEsUSm1PMMiDjihtBlZUi_ Xref: g2news2.google.com comp.lang.ada:7589 Date: 2006-11-20T13:40:50-08:00 List-Id: markww wrote: > > I was planning on having each node use the same generic type once > instantiated. I am still new with Ada, but thought it would work > similarly to C++: > > vector vMyVector; > > now this instance of the vector can only contain type CMyClassType. That's exactly how it would work in Ada05 too: with My_Types; use My_Types; with Ada.Containers.Vectors; package My_Vector_Types is new Ada.Containers.Vectors (My_Class_Type); where My_Types is an instantiation of some generic package containing the declaration of type My_Class_Type.