I've got two classes
DeBase can serialize, Derive cannot serialize (it has bits that I do not want to be serialized). Derived is stored in a tag of some UI control. I'm extracting it like
If I just want the base part of Derived, in C++, I do something like
but bbb is still Derived so when I try serializing, it fails. The only way I've found around it is
Problem is bbb is quite big and I don't really want to do individual assignments of every single member in it. Is there a more elegant way of doing this?
Code:
class DeBase
{
...
}
class Derived: DeBase
{
...
}
Code:
Derived ddd = (Derived) combo.tag;
Code:
DeBase bbb = (DeBase) ddd;
Code:
DeBase bbb = new DeBase();
bbb.something = ddd.something;