From -615075267020404401
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: niklasb@my-deja.com
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/24
Message-ID: <7ps4b5$fe6$1@nnrp1.deja.com>#1/1
X-Deja-AN: 516719509
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <7nt3vl$1oe$1@nnrp1.deja.com> <7oh7o8$t3f$1@nnrp1.deja.com> <7ol6hi$ej9$2@news.BelWue.DE> <cTiioXAhAwr3Ew$X@robinton.demon.co.uk> <t7d7ww1vrz.fsf@calumny.jyacc.com> <e4DSyfA4ALs3Ew0Q@robinton.demon.co.uk> <t7r9laz5hj.fsf@calumny.jyacc.com> <7oup0a$8g2$1@nnrp1.deja.com> <37B3C2AD.5AB722AE@lucent.com> <37B5A571.449B@wanadoo.fr> <37B908A8.717CAC2C@lucent.com> <CVJFZFAbaWu3Ew15@robinton.demon.co.uk> <7pcvjs$tk4$1@nnrp1.deja.com> <user-1808991258230001@aus-as3-121.io.com> <37BBE6CC.FE2475E5@physik.tu-muenchen.de> <user-1908991352370001@aus-as5-169.io.com> <slrn7rph2r.e43.sbnaran@localhost.localdomain> <37C15129.B9D9255F@wizard.net>
X-Original-Date: Mon, 23 Aug 1999 18:36:22 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
X-Complaints-To: news@news.unimelb.edu.au
X-Http-Proxy: 1.0 RED-PRXY-06, 1.0 x38.deja.com:80 (Squid/1.1.22) for client 131.107.3.76
X-Trace: izvestia.its.unimelb.edu.au 935526269 31298 128.250.29.17 (24 Aug 1999 20:24:29 GMT)
Organization: Deja.com - Share what you know. Learn what you don't.
X-Article-Creation-Date: Mon Aug 23 18:36:22 1999 GMT
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN8L/Y+EDnX0m9pzZAQEYCQF+JT5FNaqWsgxV2upgGAnwiEdCfOuF+lKa D3nxQFrgtAi6lUuQd/WggaZBpOKbmcY0 =5h1F
X-MyDeja-Info: XMYDJUIDniklasb
NNTP-Posting-Date: 24 Aug 1999 20:24:29 GMT
Newsgroups: comp.std.c++

In article <37C15129.B9D9255F@wizard.net>,
  "James Russell Kuyper Jr." <kuyper@wizard.net> wrote:
>
> "Siemel B. Naran" wrote:
>
> > On 19 Aug 1999 20:16:34 GMT, blargg
<postmast.root.admi.gov@iname.com> wrote:
> >
> > >This could be true, but why throw away information? The user can
always
> > >remove it if they want.
> >
> > On the other hand, they could always add the information if they
want.
>
> You can't add the information back once you've thrown it away. What
> you'd need would be yet another keyword, let's call it cvqual(T),
which
> returns a number indicating whether a top level 'const', 'volatile',
or
> both, would be thrown away by typeof(T).

The 'information' in question here is the reference qualifer,
not the const/volatile qualifer. This is unclear because the
article blargg was responding to has been cut, so here it is
again.

In article <37BBE6CC.FE2475E5@physik.tu-muenchen.de>, Christopher
Eltschka
<celtschk@physik.tu-muenchen.de> wrote:

:: [...]
::
:: If we go to modify the variable, it only makes sense if we know
:: from the beginning that the function returns a reference. And
:: then we can put the reference litterally.

So, "why throw away information?" With regard to the reference
qualifier, Christopher has already answered that: because the
code that uses a variable or type *needs to know* whether it
is a reference; the reference qualifier should therefore be
explicit, not a variable that depends on some unknown.

As to const and volatile, we are in agreement. I have come
around to the view that these should be retained.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]



