struct Base {
int i, j;
};
struct Derived : Base {};
With above scenario, if we do following:
Base b;
auto& d = static_cast<Derived&>(b);
d.i = 1;
Will it be an undefined behaviour?
Note: For some reasons, I can't edit the code of an auto generated google protobuf library. Hence, extending those classes to my custom class, which provides more types & APIs, but it doesn't have any extra data member.