With the exception of the copy assignment statement, another overloaded statement can be inherited.
I agree that the default copy-assignment of SubC overshadows the overloaded C assignment operator.
If SubC does not provide a copy assignment operator, the compiler will perform the copy operation as follows:
class SubC : public C { public: SubC & operator=( const SubC & other ); }
then "SubC and operator = (const SubC, etc.)" overlap the assignment operator C, leading to a compilation error.
If
SubC other; SubC subC; subC = other;
then, this case, compile ok.
source share