mirror of
https://github.com/monero-project/monero.git
synced 2025-08-08 04:32:17 -04:00
serialization: add deque serialization
This commit is contained in:
parent
fa54b20584
commit
493fad8053
3 changed files with 70 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue