mirror of
https://github.com/boostorg/unordered.git
synced 2025-11-08 11:41:44 +01:00
added serialization support (pending docs and testing)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
|
||||
// Copyright (C) 2003-2004 Jeremy B. Maitin-Shepard.
|
||||
// Copyright (C) 2005-2011 Daniel James.
|
||||
// Copyright (C) 2022 Christian Mazakas
|
||||
// Copyright (C) 2022-2023 Christian Mazakas
|
||||
// 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)
|
||||
|
||||
@@ -20,6 +19,7 @@
|
||||
#include <boost/functional/hash.hpp>
|
||||
#include <boost/move/move.hpp>
|
||||
#include <boost/unordered/detail/set.hpp>
|
||||
#include <boost/unordered/detail/serialize_fca_container.hpp>
|
||||
#include <boost/unordered/detail/type_traits.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
@@ -641,6 +641,13 @@ namespace boost {
|
||||
#endif
|
||||
}; // class template unordered_set
|
||||
|
||||
template <class Archive, class K, class H, class P, class A>
|
||||
void serialize(
|
||||
Archive & ar,unordered_set<K, H, P, A>& c,unsigned int version)
|
||||
{
|
||||
detail::serialize_fca_container(ar, c, version);
|
||||
}
|
||||
|
||||
#if BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES
|
||||
|
||||
template <class InputIterator,
|
||||
@@ -1290,6 +1297,13 @@ namespace boost {
|
||||
#endif
|
||||
}; // class template unordered_multiset
|
||||
|
||||
template <class Archive, class K, class H, class P, class A>
|
||||
void serialize(
|
||||
Archive & ar,unordered_multiset<K, H, P, A>& c,unsigned int version)
|
||||
{
|
||||
detail::serialize_fca_container(ar, c, version);
|
||||
}
|
||||
|
||||
#if BOOST_UNORDERED_TEMPLATE_DEDUCTION_GUIDES
|
||||
|
||||
template <class InputIterator,
|
||||
@@ -2367,6 +2381,21 @@ namespace boost {
|
||||
boost::swap(x.position, y.position);
|
||||
}
|
||||
} // namespace unordered
|
||||
|
||||
namespace serialization {
|
||||
template <class K, class H, class P, class A>
|
||||
struct version<boost::unordered_set<K, H, P, A> >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, value = 1);
|
||||
};
|
||||
|
||||
template <class K, class H, class P, class A>
|
||||
struct version<boost::unordered_multiset<K, H, P, A> >
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(int, value = 1);
|
||||
};
|
||||
} // namespace serialization
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
|
||||
Reference in New Issue
Block a user