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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fccea7ca608399cd,start X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-xxxfer.readnews.com!textspool1.readnews.com!news-out.readnews.com!postnews3.readnews.com!not-for-mail Date: Wed, 14 Jan 2009 19:32:25 -0500 From: "Peter C. Chapin" User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Vector of Vectors. X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <496e8418$0$25733$4d3efbfe@news.sover.net> Organization: SoVerNet (sover.net) NNTP-Posting-Host: fa9a2d63.news.sover.net X-Trace: DXC=CbM10l:5Z]2fe>HaoCKRX>K6_LM2JZB_3fRmOLfo9C@<3?@`i3kGa5;\;]hg0[U4<8V7QdGn]=TU? X-Complaints-To: abuse@sover.net Xref: g2news2.google.com comp.lang.ada:4279 Date: 2009-01-14T19:32:25-05:00 List-Id: I'm having a bit of trouble manipulating an element of a vector of vectors. I'm using GNAT GPL 2008. Here is a small program to illustrate the issue: with Ada.Containers.Vectors; procedure Check is package Integer_Vectors is new Ada.Containers.Vectors (Index_Type => Natural, Element_Type => Integer); package Nested_Vectors is new Ada.Containers.Vectors (Index_Type => Natural, Element_Type => Integer_Vectors.Vector, "=" => Integer_Vectors."="); IV : Integer_Vectors.Vector; NV : Nested_Vectors.Vector; begin IV.Append(42); NV.Append(IV); NV.Element(0).Append(43); -- Compile error here. end Check; The error message is, "Actual for Container must be a variable." I understand what this means. The problem is that I'm trying to use an expression as an argument for an 'in out' parameter. What I'm having trouble figuring out is how to work around this. I tried using 'renames' to give a simple name to NV.Element(0) but that didn't fool the compiler (no surprise). I also tried playing around with anonymous access types but I couldn't figure out how to declare the Element_Type of package Nested_Vectors to be aliased. I'm not sure if it would have worked in any case. Surely there must be a straight forward way to do this! Peter