mirror of
https://github.com/monero-project/monero.git
synced 2025-08-10 22:30:14 -04:00
split variant into plain and optional, add variant serialization
This commit is contained in:
parent
35eb5c1174
commit
04fe6fa63f
3 changed files with 92 additions and 34 deletions
|
@ -43,6 +43,7 @@
|
|||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/front.hpp>
|
||||
#include <boost/mpl/pop_front.hpp>
|
||||
#include "common/variant.h"
|
||||
#include "serialization.h"
|
||||
|
||||
/*! \struct variant_serialization_triats
|
||||
|
@ -144,3 +145,13 @@ static bool do_serialize(Archive<true> &ar, boost::variant<T...> &v)
|
|||
{
|
||||
return boost::apply_visitor(variant_write_visitor<Archive>(ar), v);
|
||||
}
|
||||
|
||||
// implementation for tools::variant delegates to internal boost::variant member field
|
||||
namespace tools
|
||||
{
|
||||
template <class Archive, typename... Ts>
|
||||
bool do_serialize(Archive &ar, variant<Ts...> &v)
|
||||
{
|
||||
return do_serialize(ar, v.m_value);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue