From 2d17feb060275083424d3b5978282b22a5dc88ac Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 22 Dec 2017 19:47:12 +0000 Subject: factor STL container serialization --- src/serialization/serialization.h | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/serialization/serialization.h') diff --git a/src/serialization/serialization.h b/src/serialization/serialization.h index 9e23f0791..56496c790 100644 --- a/src/serialization/serialization.h +++ b/src/serialization/serialization.h @@ -63,15 +63,17 @@ struct is_blob_type { typedef boost::false_type type; }; template struct has_free_serializer { typedef boost::true_type type; }; -/*! \struct is_pair_type +/*! \struct is_basic_type * * \brief a descriptor for dispatching serialize */ template -struct is_pair_type { typedef boost::false_type type; }; +struct is_basic_type { typedef boost::false_type type; }; template -struct is_pair_type> { typedef boost::true_type type; }; +struct is_basic_type> { typedef boost::true_type type; }; +template<> +struct is_basic_type { typedef boost::true_type type; }; /*! \struct serializer * @@ -89,7 +91,7 @@ struct is_pair_type> { typedef boost::true_type type; }; template struct serializer{ static bool serialize(Archive &ar, T &v) { - return serialize(ar, v, typename boost::is_integral::type(), typename is_blob_type::type(), typename is_pair_type::type()); + return serialize(ar, v, typename boost::is_integral::type(), typename is_blob_type::type(), typename is_basic_type::type()); } template static bool serialize(Archive &ar, T &v, boost::false_type, boost::true_type, A a) { @@ -361,9 +363,3 @@ namespace serialization { return r && check_stream_state(ar); } } - -#include "string.h" -#include "vector.h" -#include "list.h" -#include "pair.h" -#include "set.h" -- cgit v1.2.3