Can you cast an object to a string of hex data (similar to how packets are sent) and then store that and then cast the object back? I know its possible with C structs which are basically objects undearneath in C++.
Compatibility of the serialization across different systems isn't important.
auto obj = new Something();
auto objHex = (unsigned char*) obj;
// store objHex in like a db
// retrieve objHex
auto obj2 = new Something(); // allocate
*obj2 = (Something*) objHex; // set the dereference
See Question&Answers more detail:os