Article View: comp.std.c++
Article #1717Re: virtual base class construction
From: J. Kanze
Date: Fri, 11 Aug 1995 17:01
Date: Fri, 11 Aug 1995 17:01
29 lines
1608 bytes
1608 bytes
John Max Skaller (maxtal@Physics.usyd.edu.au) wrote:
|> For example how do you do assignments in the presence of
|> virtual bases? What stops the data of the virtual base being assigned
|> more than once?
C&
C::operator( C const& other )
{
if ( this != &other )
{
this->~C() ;
new ( this ) C( other ) ;
}
return *this ;
}
No duplicate assignment of the virtual bases of C. (This is not to say
that this is a perfect solution for everything, nor to argue against
John's other arguements. Without being categorical, I don't think I've
actually every had any data in a virtual base.)
--
James Kanze (+33) 88 14 49 00 email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils en informatique industrielle--
--Beratung in industrieller Datenverarbeitung
--
Steve Clamage, stephen.clamage@eng.sun.com
Technical Details
Message-ID:
<40g1nl$2jo@gabi.gabi-soft.fr>Path:
arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamageReferences:
<648258751wnr@hi-q.demon.co.uk> <3u6mnq$bag@fsgm01.fnal.gov> <3ullqp$1uu@metro.ucc.su.OZ.AU> <3up5ne$4gv@fsgm01.fnal.gov> <401gnk$mk0@metro.ucc.su.OZ.AU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage From: kanze@gabi-soft.fr (J. Kanze) Newsgroups: comp.std.c++ Subject: Re: virtual base class construction Date: 11 Aug 1995 17:01:06 GMT Organization: GABI Software, Sarl. Approved: clamage@eng.sun.com (comp.std.c++) Distribution: inet Message-ID: <40g1nl$2jo@gabi.gabi-soft.fr> References: <648258751wnr@hi-q.demon.co.uk> <3u6mnq$bag@fsgm01.fnal.gov> <3ullqp$1uu@metro.ucc.su.OZ.AU> <3up5ne$4gv@fsgm01.fnal.gov> <401gnk$mk0@metro.ucc.su.OZ.AU> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Newsreader: TIN [version 1.2 PL2] Content-Length: 874 X-Lines: 26 Originator: clamage@taumet