From -2012865083972855917
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: Valentin Bonnard <Bonnard.V@wanadoo.fr>
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/13
Message-ID: <37B43D99.608A@wanadoo.fr>#1/1
X-Deja-AN: 512347966
X-NNTP-Posting-Host: croiseur.ens.fr
Content-Transfer-Encoding: 7bit
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>
X-UID: 0000000001
X-Status: $$$T
Content-Type: text/plain; charset=us-ascii
Organization: Ecole normale superieure
Mime-Version: 1.0
Newsgroups: comp.std.c++
Originator: clamage@taumet


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.
> 
>  I disagree 

Not really

>  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.

-- 

Valentin Bonnard


[ 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              ]




