I\'m having trouble with the inheritance of operator=. Why doesn\'t this code work, and what is the best way to fix it?
#include
class A
{
Normally, operator= is defined in B as
B& operator=(B const &);
Since B is not an unambiguous and accessible base of 'C', the conversion from C to B is not allowed by the compiler.
If you really want to have a 'C' be assigned to 'B', 'B' should support an appropriate assignment operator as
B& operator=(C const &);