Get member offset in a non-POD type

Hello Vlad,

Take a look on ASTRecordLayout class. It may solve some of your problems.
As I understand, you can also take a look on some existing solutions (Boost::serialization, protobuf).