From 5534260000141095263 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,cc5b2194d357e113 X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2003-02-21 08:44:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull From: francis.glassborow@ntlworld.com (Francis Glassborow) Newsgroups: comp.std.c++ Subject: Re: Virtual Base Constructors Date: Fri, 21 Feb 2003 16:44:08 +0000 (UTC) Organization: Southfield Microcomputer SS Lines: 52 Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++) Message-ID: <1trs9ECfMhV+Ew9M@robinton.demon.co.uk> References: <58F604E3D17AD4119D8600508BE325060EA9A2F1@emss07m04.lmtas.lmco.com> Mime-Version: 1.0 Content-Type: text/plain;charset=us-ascii;format=flowed X-Trace: mail2news.demon.co.uk 1045845848 26248 10.0.0.1 (21 Feb 2003 16:44:08 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 21 Feb 2003 16:44:08 +0000 (UTC) X-Received: from mulga.cs.mu.oz.au ([128.250.1.22]) by news.demon.co.uk with esmtp (Exim 4.05) id 18mGHO-0006pC-00 for mail2news@news.news.demon.net; Fri, 21 Feb 2003 16:44:07 +0000 X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU id DAA03218; Sat, 22 Feb 2003 03:44:02 +1100 (EST) X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Path: comp-std-cpp-robomod!not-for-mail X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-Delivered-To: std-c++@ncar.ucar.edu X-Reply-To: Francis Glassborow X-Newsgroups: comp.std.c++ X-User-Agent: Turnpike/6.02-U () X-Spam-Status: No, hits=-0.7 required=5.0 tests=NOSPAM_INC,REFERENCES,SIGNATURE_SHORT_DENSE, SPAM_PHRASE_00_01,USER_AGENT version=2.43-cvs Xref: archiver1.google.com comp.std.c++:17999 In article <58F604E3D17AD4119D8600508BE325060EA9A2F1@emss07m04.lmtas.lmco.com>, "Hickman, Greg" writes >If a compiler can ascertain that a class with a virtual base isn't >instantiable, wouldn't it be possible to allow that class to omit calling >the constructor of the virtual base since it will have to be called by a >more derived class anyway? > >For example, > >class Io_object { >public: > virtual ~Io_object() {} > virtual void read_from(const Io_reader&) = 0; > virtual void write_to(const Io_writer&) const = 0; >protected: > Io_object(const Io_type&); As this is already an ABC what is this for in a stateless class. >}; > >class Base : public virtual Io_object { >public: > void foo() = 0; >protected: > Base(const Io_type& type) : Io_object(type) {} Why are you explicitly calling a ctor for a stateless base class? >}; > >class Concrete : public Base { >}; > >Do we really have to require that Base call the Io_object constructor even >though it ultimately *has* to be handled by the Concrete type anyway? Please give an example where the required base ctor would not be compiler generated. -- ACCU Spring Conference 2003 April 2-5 The Conference you cannot afford to miss Check the details: http://www.accuconference.co.uk/ Francis Glassborow ACCU --- [ 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://www.jamesd.demon.co.uk/csc/faq.html ]