From -6590423634897859796
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: sirwillard@my-deja.com
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/16
Message-ID: <7pa195$prj$1@nnrp1.deja.com>#1/1
X-Deja-AN: 513583883
X-NNTP-Posting-Host: 167.16.75.51
Approved: stephen.clamage@sun.com (comp.std.c++)
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> <37B2E9B8.491D@wanadoo.fr> <slrn7r5tnl.kn9.sbnaran@localhost.localdomain> <37B43D99.608A@wanadoo.fr>
X-UID: 0000000001
X-Status: $$$T
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)
X-Http-Proxy: 1.1 x29.deja.com:80 (Squid/1.1.22) for client 167.16.75.51
Organization: Deja.com - Share what you know. Learn what you don't.
X-Article-Creation-Date: Mon Aug 16 21:53:46 1999 GMT
X-MyDeja-Info: XMYDJUIDsirwillard
Newsgroups: comp.std.c++
Originator: clamage@taumet


In article <37B43D99.608A@wanadoo.fr>,
  Valentin Bonnard <Bonnard.V@wanadoo.fr> wrote:
>
> Siemel B. Naran wrote:
>
> > On 12 Aug 99 15:37:37 GMT, Valentin Bonnard <Bonnard.V@wanadoo.fr>
wrote:
> > >sirwillard@my-deja.com wrote:
> >
> > >> base* p = new derived;
> > >> typeof(*p) copy(*p);
> > >
> > >This one is easy: it's crystal-clear that it should create
> > >a base initialized with the derived object.

Not so crystal clear.  The first thing that must be decided is
if 'typeof' performs static typing or runtime typing.  Seems people
don't agree on this one within this thread.  This is why I brought the
subject up... not because we can't come to a conclusion and define
proper semantics for it, but because the proper semantics have to be
defined in order to make a proposal.

> >  it's crystal-clear that it should create
> >  a base initialized with the base part of 'p', even if there
> >  is a constructor base::base(const derived&).  That is, we
> >  have a call to base::base(const base&).
>
> The object passed to the ctor is still a derived object.

Is it?  By dereferencing a base pointer, did I not slice the object?


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              ]




