From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: Generic access type convention and aliasing
Date: Tue, 07 May 2013 08:42:52 +0200
Date: 2013-05-07T08:42:52+02:00 [thread overview]
Message-ID: <op.wwpblqg8ule2fv@cardamome> (raw)
In-Reply-To: op.wwo9q8s2ule2fv@cardamome
Le Tue, 07 May 2013 08:02:58 +0200, Yannick Duchêne (Hibou57)
<yannick_duchene@yahoo.fr> a écrit:
> 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‑more.
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 however
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 the
private part, that would be OK (the public declaration would just have to
tell what the type is).
--
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University
next prev parent reply other threads:[~2013-05-07 6:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-06 0:20 Generic access type convention and aliasing Yannick Duchêne (Hibou57)
2013-05-06 5:55 ` Yannick Duchêne (Hibou57)
2013-05-07 0:56 ` Randy Brukardt
2013-05-07 6:02 ` Yannick Duchêne (Hibou57)
2013-05-07 6:42 ` Yannick Duchêne (Hibou57) [this message]
2013-05-07 17:34 ` AdaMagica
2013-05-07 19:08 ` Yannick Duchêne (Hibou57)
2013-05-07 21:03 ` Jacob Sparre Andersen news
2013-05-07 22:13 ` Yannick Duchêne (Hibou57)
2013-05-08 11:28 ` Yannick Duchêne (Hibou57)
2013-05-08 20:44 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox