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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!mx05.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: Generic access type convention and aliasing Date: Tue, 07 May 2013 08:42:52 +0200 Organization: Ada @ Home Message-ID: References: NNTP-Posting-Host: /5uFWkegPs0CGJSoRIUiIw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.15 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:15398 Date: 2013-05-07T08:42:52+02:00 List-Id: Le Tue, 07 May 2013 08:02:58 +0200, Yannick Duch=C3=AAne (Hibou57) = a =C3=A9crit: > Implicit deference, even if it avoids direct use of the access member = = > (syntactic sugar, not added safety, although a good idea) If it was a function return a view (either read, read/write or write), = that would not be only syntactic sugar any=E2=80=91more. I forget too much about C++, so I will request help from C++ gurus if = there are some here: I feel to remember something similar existed with = C++, where a function could return an object by reference instead of = returning a pointer to it. I am wrong or not? If I'm not wrong, I howeve= r = don't remember if it was safe enough: did it allow to get a pointer from= = that returned reference? (if so, that's not safe and so not worth). If the implicit deference could specify a discriminant only visible in t= he = private part, that would be OK (the public declaration would just have t= o = tell what the type is). -- = =E2=80=9CSyntactic sugar causes cancer of the semi-colons.=E2=80=9D [1] =E2=80=9CStructured Programming supports the law of the excluded muddle.= =E2=80=9D [1] [1]: Epigrams on Programming =E2=80=94 Alan J. =E2=80=94 P. Yale Univers= ity