No inheritance found with operator= and initializer_list

Your problem is when you try something as

BB bb1;

bb1 = { -1.0f, -1.0f, 0.0f };

not when you try to initialize your BB object with an initializer list. The error is coming from operator=().

To solve your problem, I suggest that you add a using, in your BB class, as follows

class BB: public AA
      using AA::operator=;

The problem is that BB implicitly define a couple of operator=() (the copy and the move operator=(): BB & BB::operator= (BB const &) and BB & BB::operator= (BB &&) respectively) that hide the operators inherited from AA.

To un-hide them, you have to explicitly bring them into scope with a using declaration.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top