KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Assuming I have a base class A and publicly derived class B, how should I assign A object to the A base class subobject of B? class A {...}; class B : public A {...}; A a(..); B b(..); static_cast<A&>(b) = a; ??? Is that doable without writing assignement operator for B? Are there any potential problems with casting b to A&? Is that standard conformant?
Tags (comma-separated)
Save Edits
Cancel