added first tests of serialization support

This commit is contained in:
joaquintides
2023-08-15 15:55:13 +02:00
parent ff9d08a917
commit d83efc5ea4
3 changed files with 165 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
// Copyright 2006-2009 Daniel James.
// Copyright 2022 Christian Mazakas
// Copyright 2023 Joaqui M Lopez Munoz
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -11,6 +12,7 @@
#include "../helpers/fwd.hpp"
#include "../helpers/memory.hpp"
#include <boost/config.hpp>
#include <boost/core/serialization.hpp>
#include <boost/limits.hpp>
#include <cstddef>
@@ -74,6 +76,14 @@ namespace test {
{
return out << "(" << o.tag1_ << "," << o.tag2_ << ")";
}
template<typename Archive>
void serialize(Archive& ar,unsigned int)
{
ar & boost::core::make_nvp("tag1", tag1_);
ar & boost::core::make_nvp("tag2", tag2_);
}
};
class movable : private counted_object