40 #include <boost/variant/variant.hpp>
41 #include <boost/variant/apply_visitor.hpp>
42 #include <boost/variant/static_visitor.hpp>
43 #include <boost/mpl/empty.hpp>
44 #include <boost/mpl/if.hpp>
45 #include <boost/mpl/front.hpp>
46 #include <boost/mpl/pop_front.hpp>
55 template <
class Archive,
class T>
64 template <
class Archive,
class Variant,
class TBegin,
class TEnd>
68 typedef typename boost::mpl::next<TBegin>::type
TNext;
78 ar.stream().setstate(std::ios::failbit);
92 template <
class Archive,
class Variant,
class TBegin>
99 ar.stream().setstate(std::ios::failbit);
105 template <
template <
bool>
class Archive, BOOST_VARIANT_ENUM_PARAMS(
typename T)>
110 typedef typename variant_type::types
types;
115 ar.read_variant_tag(t);
117 typename boost::mpl::begin<types>::type,
118 typename boost::mpl::end<types>::type>::read(ar, v, t))
120 ar.stream().setstate(std::ios::failbit);
128 template <
template <
bool>
class Archive, BOOST_VARIANT_ENUM_PARAMS(
typename T)>
134 struct visitor :
public boost::static_visitor<bool>
141 bool operator ()(
T &rv)
const
147 ar.stream().setstate(std::ios::failbit);
156 return boost::apply_visitor(visitor(ar), v);
const uint32_t T[512]
Definition: groestl_tables.h:37
string a
Definition: MakeCryptoOps.py:15
void do_serialize(boost::mpl::false_, Archive &a, epee::net_utils::network_address &na)
Definition: net_peerlist_boost_serialization.h:53
Definition: unordered_containers_boost_serialization.h:39
Simple DSL AAPI based on.
#define true
Definition: stdbool.h:37
#define false
Definition: stdbool.h:38
variant_type::types types
Definition: variant.h:110
Archive< false >::variant_tag_type variant_tag_type
Definition: variant.h:109
boost::variant< BOOST_VARIANT_ENUM_PARAMS(T)> variant_type
Definition: variant.h:108
static bool serialize(Archive< false > &ar, variant_type &v)
Definition: variant.h:112
Archive< true > & ar
Definition: variant.h:136
visitor(Archive< true > &a)
Definition: variant.h:138
boost::variant< BOOST_VARIANT_ENUM_PARAMS(T)> variant_type
Definition: variant.h:131
static bool serialize(Archive< true > &ar, variant_type &v)
Definition: variant.h:155
... wouldn't a class be better?
Definition: serialization.h:92
Archive::variant_tag_type variant_tag_type
Definition: variant.h:95
static bool read(Archive &ar, Variant &v, variant_tag_type t)
Definition: variant.h:97
reads a variant
Definition: variant.h:66
boost::mpl::deref< TBegin >::type current_type
Definition: variant.h:69
Archive::variant_tag_type variant_tag_type
Definition: variant.h:67
static bool read(Archive &ar, Variant &v, variant_tag_type t)
Definition: variant.h:72
boost::mpl::next< TBegin >::type TNext
Definition: variant.h:68