Greg Ewing schrieb:
> Blake Ross wrote:
>> C++ ensures that virtual bases
>> are only constructed once,
> 
> As far as I remember, C++ ensures this by not calling
> the base constructors automatically at all, leaving
> you to explicitly call the constructors of all the
> virtual bases that you inherit.

That's not true. A virtual base constructor is always
called directly from the most-specific constructor
(i.e. from the constructor of the object being created).
If no explicit base constructor call is present in that
constructor, an implicit call to the default constructor
is made.

So if the base class does not have a default constructor,
you indeed need to explicitly add a constructor call into
each subclass.

HTH,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to