I wish to know if i only declare (and not define) a default constructor in a derived class, why doesn't the base class constructor gets invoked when i create an object of derived class?
Also is it a common practice to only declare default constructors? If yes, what are advantages of the same?
class A
{
private:
A() {}
}
class B : public A
{
B();
}
doesn't give compilation errors, but
class B : public A
{
B() {}
}
gives the error :- In constructor B::B(): error: A::A() is private.
What is the justification for the same?