Use load_construct_data for kernel objects

This commit is contained in:
Hamish Milne 2019-12-27 18:52:33 +00:00 committed by zhupengfei
parent 3ed8d95866
commit 6917eaf53b
35 changed files with 158 additions and 113 deletions

View file

@ -3,26 +3,26 @@
#include <atomic>
#include <boost/serialization/split_free.hpp>
namespace boost::serialization
namespace boost::serialization {
template <class Archive, class T>
void serialize(Archive& ar, std::atomic<T>& value, const unsigned int file_version)
{
template <class Archive, class T>
void serialize(Archive& ar, std::atomic<T>& value, const unsigned int file_version)
{
boost::serialization::split_free(ar, value, file_version);
}
boost::serialization::split_free(ar, value, file_version);
}
template <class Archive, class T>
void save(Archive& ar, const std::atomic<T>& value, const unsigned int file_version)
{
ar << value.load();
}
template <class Archive, class T>
void save(Archive& ar, const std::atomic<T>& value, const unsigned int file_version)
{
ar << value.load();
}
template <class Archive, class T>
void load(Archive& ar, std::atomic<T>& value, const unsigned int file_version)
{
T tmp;
ar >> tmp;
value.store(tmp);
}
template <class Archive, class T>
void load(Archive& ar, std::atomic<T>& value, const unsigned int file_version)
{
T tmp;
ar >> tmp;
value.store(tmp);
}
} // namespace boost::serialization