一个头文件

感觉周末写的序列化有点笨

我改良了下 如下:

 

:)

 

/* 核动力机器人 hi.csdn.net/ccsdu2004 */ //2009.05.17 //档案头文件 #ifndef G_ARCHIVE_HPP #define G_ARCHIVE_HPP //使用 boost序列化对象 #include <boost/archive/text_oarchive.hpp> #include <boost/archive/text_iarchive.hpp> #include <boost/archive/xml_oarchive.hpp> #include <boost/archive/xml_iarchive.hpp> #include <boost/archive/binary_oarchive.hpp> #include <boost/archive/binary_iarchive.hpp> #define ACCESS_ARCHIVE friend class boost::serialization::access; #define BEGIN_ARCHIVE / ACCESS_ARCHIVE / template<class Archive> / void serialize(Archive & archive, const unsigned int version = 0) / { #define END_ARCHIVE / } #endif /* 使用例子: class Vect { public: BEGIN_ARCHIVE archive &x; END_ARCHIVE private: int x; }; */

你可能感兴趣的:(serialization,Class,Access,archive)