R
Ron Natalie
Christoph Rabel said:Base(0); // Compiles fine, but
This probably does not do what you think. This creates a temporary object of
type Base (initialized with a 0). It is not, as you might be expecting, a call
to the Base class constructor on the curent object.
This line isn't valid. Base::Base is not valid at all in this context.Base::Base(0); // Does not compile, Comeau says:
Comeau's error message is a bit obtuse but since it's not a valid
construct it's just trying to take a stab at what it thinks you're
trying to do.
What you really want is:
Derived(int i) : Base(0) { }