cereal/boost_serialize.cpp
Shane Grant e9d277025f const_cast for save(), seeking for binary_oarchive
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
2013-06-14 12:17:21 -07:00

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;
}