mirror of
https://github.com/RPCS3/cereal.git
synced 2024-11-27 13:10:43 +00:00
e9d277025f
Using const cast to get rid of having two versions of save (changed vector and array so far) Initial implementation of seeking to allow saving and restoring position within a binary archive
35 lines
579 B
C++
35 lines
579 B
C++
#include <boost/serialization/serialization.hpp>
|
|
#include <boost/archive/text_oarchive.hpp>
|
|
#include <boost/archive/text_iarchive.hpp>
|
|
#include <boost/serialization/vector.hpp>
|
|
#include <boost/config.hpp>
|
|
#include <vector>
|
|
#include <iostream>
|
|
|
|
struct myStruct
|
|
{
|
|
myStruct() : x(0) {}
|
|
int x;
|
|
|
|
|
|
template<class Archive>
|
|
void serialize(Archive & ar, const unsigned int version)
|
|
{
|
|
ar & x;
|
|
}
|
|
};
|
|
|
|
|
|
int main()
|
|
{
|
|
boost::archive::text_oarchive oa(std::cout);
|
|
|
|
const myStruct v;
|
|
|
|
oa & v;
|
|
|
|
std::cout << BOOST_NO_FUNCTION_TEMPLATE_ORDERING << std::endl;
|
|
|
|
return 0;
|
|
}
|