From -6867147289437840354
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: "James Kuyper Jr." <kuyper@wizard.net>
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/19
Message-ID: <37BAA819.F62EF2E7@wizard.net>#1/1
X-Deja-AN: 514601022
Content-Transfer-Encoding: 7bit
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>
X-Original-Date: Wed, 18 Aug 1999 08:33:29 -0400
X-Accept-Language: en-US,en-GB,de,es,ru
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 935051101 17464 128.250.29.17 (19 Aug 1999 08:25:00 GMT)
Organization: Not Enough
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN7u/R+EDnX0m9pzZAQFoGAF9HFnEEXPxN6uZZYl43kp4K0V+faZEhN+p b7pmetT726QzWsA0SCJ1V4mHJ8VgcaLq =JBCz
Mime-Version: 1.0
NNTP-Posting-Date: 19 Aug 1999 08:25:00 GMT
Newsgroups: comp.std.c++

niklasb@my-deja.com wrote:
....
> Ok, here's my first crack at spelling out the rules for
> a "typeof" keyword (without attempting to argue for why
> it's useful). I don't claim to be a language designer, so
> please be gentle when you tear this apart.
....
> 3 When applied to a reference or a reference type,
>   the result is the referenced type. When applied
>   to a constant reference or constant reference type,
>   the resulting type is not constant.

Why? I'm not saying it's a bad idea, I just want to know why you think
it's a good one.

>   <Example>
> 
>     vector<int> v;
>     typeof(v[0]) a; // int, not int&
> 
>     const vector<int>& cv = v;
>     typeof(cv[0]) b; // int, not const int&
> 
>   </Example>

Should this also apply to volatile?
---
[ 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              ]



