From 2954115268358259882
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: Hyman Rosen <hymie@prolifics.com>
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/12
Message-ID: <t73dxp57jw.fsf@calumny.jyacc.com>#1/1
X-Deja-AN: 511894763
Approved: Valentin Bonnard <bonnard@clipper.ens.fr>
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>
X-Original-Date: 12 Aug 1999 11:42:59 -0400
Content-Type: text/plain; charset=us-ascii
Organization: PANIX Public Access Internet and UNIX, NYC
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBVAwUAN7LsV6wEuYhIxRhxAQEeQgH+MEWFUSxTAY2TWRY8/FDB9aruzD/zOIQt 94FyDzTrIlMuD3CYWgZcoNdnMIg3U5kTSH3Jrr4EtJS04LAJAL7hxA== =F0IN
Mime-Version: 1.0
User-Agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3
Newsgroups: comp.std.c++

sirwillard@my-deja.com writes:
> Though I'd like the introduction of typeof, I feel someone should play
> at least a bit of devils advocate.  What should be the result of the
> following?
> 
> base* p = new derived;
> typeof(*p) copy(*p);

The type of typeof(*p) is base. Typeof, like sizeof, is based only on
the static type of the expression. It's a compile-time construct.
---
[ 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              ]



