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,FREEMAIL_FROM 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!nx01.iad01.newshosting.com!newshosting.com!140.99.99.194.MISMATCH!news-in-02.newsfeed.easynews.com!easynews.com!easynews!news.he.net!xara.net!gxn.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Containers - nontrivial element access Date: Wed, 03 Oct 2007 20:15:42 +0100 Organization: Pushface Message-ID: References: <1191275759.184463.238350@n39g2000hsh.googlegroups.com> <1191358254.405682.320670@22g2000hsm.googlegroups.com> <4hBMi.132431$Fc.72735@attbi_s21> <10xbnt0vkcyeo.5t72qwg3umwd.dlg@40tude.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1191438940 27083 62.49.19.209 (3 Oct 2007 19:15:40 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 3 Oct 2007 19:15:40 +0000 (UTC) Cancel-Lock: sha1:ylh+SL0ZBK/bbnBH/XaSEW6wW58= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (darwin) Xref: g2news2.google.com comp.lang.ada:2269 Date: 2007-10-03T20:15:42+01:00 List-Id: "Jeffrey R. Carter" writes: > C++ uses reference semantics, so that a modification of a field > modifies the value in the data structure. Ada uses value semantics, > so that modification of a field does not modify the value in the > data structure. I'm no expert, but I would have expected C++ to distinguish given struct Foo { ... }; the three different functions Foo return_by_value(); Foo* return_by_access(); Foo& return_by_reference(); I wonder what the difference between Foo* and Foo& is? I don't suppose there's any difference at the object code level? (except Foo* can be 0). --S