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,fccea7ca608399cd X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Alex R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: Vector of Vectors. Followup-To: comp.lang.ada Date: Thu, 15 Jan 2009 11:10:07 +0100 Message-ID: <6t8gc1F9ej88U1@mid.individual.net> References: <496e8418$0$25733$4d3efbfe@news.sover.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: individual.net 3DpCoEfteo0sXBKX8M5POw5z2CnLH3x8B+GrpcvLQWmGGOj4Y= Cancel-Lock: sha1:mEF0i9sUUx1s8uLWdXMIzy2zpYE= User-Agent: KNode/0.99.01 Xref: g2news2.google.com comp.lang.ada:4286 Date: 2009-01-15T11:10:07+01:00 List-Id: Jeffrey R. Carter wrote: > Peter C. Chapin wrote: >> >> Surely there must be a straight forward way to do this! > > I'd probably use Update_Element. Which one could argue is straightforward from a conceptual point of view, but requires a lot of typing. I think there was an old discussion about why it was not a good idea to have functions returning accesses to the elements for this[*], which would enable what Peter was attempting (since without something like C++ references there's no way to do this with similar code). I have done so for my use sometimes, but is ugly nonetheless. Exposing accesses to client code is not nice, to put it mildly. [*] Dangling pointers IIRC was the reason. In GNAT case I suspect that dangling cursors is not any better since they don't do reference counting anyway.