diff --git a/src/serialize.h b/src/serialize.h --- a/src/serialize.h +++ b/src/serialize.h @@ -48,22 +48,6 @@ struct deserialize_type {}; constexpr deserialize_type deserialize{}; -/** - * Used to bypass the rule against non-const reference to temporary - * where it makes sense with wrappers. - */ -template inline T &REF(const T &val) { - return const_cast(val); -} - -/** - * Used to acquire a non-const pointer "this" to generate bodies of const - * serialization operations from a template - */ -template inline T *NCONST_PTR(const T *val) { - return const_cast(val); -} - //! Safely convert odd char pointer types to standard ones. inline char *CharCast(char *c) { return c; @@ -202,20 +186,6 @@ #define SER_WRITE(obj, code) \ ::SerWrite(s, ser_action, obj, [&](Stream &s, const Type &obj) { code; }) -/** - * Implement three methods for serializable objects. These are actually wrappers - * over "SerializationOp" template, which implements the body of each class' - * serialization code. Adding "ADD_SERIALIZE_METHODS" in the body of the class - * causes these wrappers to be added as members. - */ -#define ADD_SERIALIZE_METHODS \ - template void Serialize(Stream &s) const { \ - NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize()); \ - } \ - template void Unserialize(Stream &s) { \ - SerializationOp(s, CSerActionUnserialize()); \ - } - /** * Implement the Ser and Unser methods needed for implementing a formatter * (see Using below). @@ -1108,7 +1078,7 @@ } /** - * Support for ADD_SERIALIZE_METHODS and READWRITE macro + * Support for SERIALIZE_METHODS and READWRITE macro. */ struct CSerActionSerialize { constexpr bool ForRead() const { return false; }