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,55f6e230b02eff2f X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s22.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Containers - nontrivial element access References: <1191275759.184463.238350@n39g2000hsh.googlegroups.com> In-Reply-To: <1191275759.184463.238350@n39g2000hsh.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s22 1191285580 12.201.97.213 (Tue, 02 Oct 2007 00:39:40 GMT) NNTP-Posting-Date: Tue, 02 Oct 2007 00:39:40 GMT Organization: AT&T ASP.att.net Date: Tue, 02 Oct 2007 00:39:41 GMT Xref: g2news2.google.com comp.lang.ada:2242 Date: 2007-10-02T00:39:41+00:00 List-Id: Maciej Sobczak wrote: > > vector people; > // ... > swap(people[x].salary, people[y].salary); You have to compare apples to apples. In C/++, everything is aliased, so you have to make everything aliased on the Ada side, too. That means you store access values, not objects. Then you have something similar: Swap (Left => People.Element (Left).Salary, Right => People.Element (Right).Salary); -- Jeff Carter "This trial is a travesty. It's a travesty of a mockery of a sham of a mockery of a travesty of two mockeries of a sham. ... Do you realize there's not a single homosexual on that jury?" Bananas 27