They demanded suddenly in the derived class to overload the reduction operator to the base (this is a lab, I myself would not do this).
#include <iostream> class A { }; class B: public A { operator A() { std::cout << "operator A()\n"; A a; return a; } }; int main() { B b; A a = (A)b; } When you start it does not display anything - that is, it does not cause overload. Friends said that most likely it will not work to overload the operator. I would like someone to tell in more detail why it will not work this way and what the standard writes about this.
A b2a(B b){}- KoVadim