aboutsummaryrefslogtreecommitdiff
path: root/src/serialization/serialization.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-09-10 22:30:08 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-09-25 21:16:32 +0100
commit493fad80532bb0e2c12e0f77d79d5a31c0627139 (patch)
tree9470dfb1d773a595053e27f1d6a6ed89406b4ca6 /src/serialization/serialization.h
parentfix typo in basic and core CMakeLists.txt (diff)
downloadmonero-493fad80532bb0e2c12e0f77d79d5a31c0627139.tar.xz
serialization: add deque serialization
Diffstat (limited to 'src/serialization/serialization.h')
-rw-r--r--src/serialization/serialization.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/serialization/serialization.h b/src/serialization/serialization.h
index 639240820..869f5d10e 100644
--- a/src/serialization/serialization.h
+++ b/src/serialization/serialization.h
@@ -41,6 +41,7 @@
#pragma once
#include <vector>
+#include <deque>
#include <list>
#include <string>
#include <boost/type_traits/is_integral.hpp>
@@ -198,6 +199,11 @@ inline bool do_serialize(Archive &ar, bool &v)
#define PREPARE_CUSTOM_VECTOR_SERIALIZATION(size, vec) \
::serialization::detail::prepare_custom_vector_serialization(size, vec, typename Archive<W>::is_saving())
+/*! \macro PREPARE_CUSTOM_DEQUE_SERIALIZATION
+ */
+#define PREPARE_CUSTOM_DEQUE_SERIALIZATION(size, vec) \
+ ::serialization::detail::prepare_custom_deque_serialization(size, vec, typename Archive<W>::is_saving())
+
/*! \macro END_SERIALIZE
* \brief self-explanatory
*/
@@ -292,6 +298,17 @@ namespace serialization {
vec.resize(size);
}
+ template <typename T>
+ void prepare_custom_deque_serialization(size_t size, std::deque<T>& vec, const boost::mpl::bool_<true>& /*is_saving*/)
+ {
+ }
+
+ template <typename T>
+ void prepare_custom_deque_serialization(size_t size, std::deque<T>& vec, const boost::mpl::bool_<false>& /*is_saving*/)
+ {
+ vec.resize(size);
+ }
+
/*! \fn do_check_stream_state
*
* \brief self explanatory