Вы можете определить любой вид оператора = ().Даже очень бесполезные.Но ни один из них не будет унаследован от дочернего класса.Со своего сайта ссылок я немного изменил пример, чтобы сделать его более понятным.Этот пример не скомпилируется из-за упомянутых ошибок.
class mother {
public:
mother ()
{ cout << "mother: no parameters\n"; }
explicit mother (int a):m_int(a)
{ cout << "mother: int parameter\n"; }
mother& operator=(mother const& rhs)
{
if(&rhs != this)
{
m_int = rhs.m_int;
}
return *this;
}
mother& operator=(int i)
{
m_int = i;
return *this;
}
private:
int m_int;
};
class son : public mother {
public:
explicit son (int a) : mother (a)
{ cout << "son: int parameter\n\n"; }
};
int main()
{
mother mom(2);
son daniel(0);
mom = 3;
daniel = 4; // compile error
daniel = mom; // also error
}