32#ifdef _QX_ENABLE_BOOST_SERIALIZATION
33#ifndef _QX_SERIALIZE_STD_UNIQUE_PTR_H_
34#define _QX_SERIALIZE_STD_UNIQUE_PTR_H_
40#if (BOOST_VERSION >= 105600)
42#include <boost/serialization/unique_ptr.hpp>
46#include <boost/serialization/serialization.hpp>
47#include <boost/serialization/split_free.hpp>
48#include <boost/serialization/nvp.hpp>
51namespace serialization {
53template <
class Archive,
typename T>
54inline void save(Archive & ar,
const std::unique_ptr<T> & t,
const unsigned int file_version)
56 Q_UNUSED(file_version);
57 const T * ptr = t.get();
58 ar << boost::serialization::make_nvp(
"std_unique_ptr", ptr);
61template <
class Archive,
typename T>
62inline void load(Archive & ar, std::unique_ptr<T> & t,
const unsigned int file_version)
64 Q_UNUSED(file_version);
66 ar >> boost::serialization::make_nvp(
"std_unique_ptr", ptr);
70template <
class Archive,
typename T>
71inline void serialize(Archive & ar, std::unique_ptr<T> & t,
const unsigned int file_version)
73 boost::serialization::split_free(ar, t, file_version);
void serialize(Archive &ar, boost::tuple< T0, T1 > &t, const unsigned int file_version)
void load(Archive &ar, boost::unordered_map< Key, Value > &t, const unsigned int)
void save(Archive &ar, const boost::unordered_map< Key, Value > &t, const unsigned int)