Is this static_cast downcast valid?
// non-virtual, may be non-trivially copyable
struct Base{
int m_object;
};
// Derived class have only non-virtual functions
struct A : Base{
void arggh(){
std::cout << "Arrghh " << m_object;
}
};
int main() {
Base base{190};
A& a = static_cast<A&>(base);
a.arggh();
return 0;
}
I mean, CREATE base class, and then cast to derived.