inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { READWRITE(field1); if(ser_action.ForRead() && (s.size() == 0)) { field2 = 0; return; } READWRITE(field2); }
inline void SerializationOp(Stream& s, Operation ser_action) { if (ser_action.ForRead()) { str.clear(); char c = 0; while (true) { try { READWRITE(c); str.push_back(c); } catch (const std::ios_base::failure& e) { break; } } } else { for (size_t i = 0; i < str.size(); i++) READWRITE(str[i]); } }