It seems that implicit cast from cont to non-const parent class is ok with gcc, can someone explain me why?
class A
{
public:
A() = default;
int& get()
{
return a;
}
private:
int a = 2;
};
class B : public A
{
public:
B() = default;
};
const B b;
A a = b; //< Why this line of code compiles?!
a.get() = 23;