10 #include <boost/none.hpp> 11 #include <boost/variant.hpp> 30 template <
typename Sequence>
31 struct make_boost_variant_over_impl;
33 template <
template <
typename...>
class Sequence,
typename... Ts>
34 struct make_boost_variant_over_impl<Sequence<Ts...>> {
37 "Cannot create a boost::variant with a 'void' type.");
38 using type = boost::variant<Ts...>;
49 template <
typename Sequence>
51 tmpl::remove_duplicates<Sequence>>::type;
55 template <
class T,
class... Ts>
56 char pup_helper(
int& index, PUP::er& p, boost::variant<Ts...>& var,
57 const int send_index) {
58 if (index == send_index) {
59 if (p.isUnpacking()) {
64 p | boost::get<T>(var);
73 template <
class... Ts>
74 void pup(er& p, boost::variant<Ts...>& var) noexcept {
76 int send_index = var.which();
79 ::BoostVariant_detail::pup_helper<Ts>(index, p, var, send_index)...};
82 template <
typename... Ts>
83 inline void operator|(er& p, boost::variant<Ts...>& d) noexcept {
92 template <
typename... Ts>
94 const boost::variant<Ts...>& variant) noexcept {
99 {pretty_type::get_name<Ts>()...}}[static_cast<size_t>(variant.which())];
105 void pup(er& p, boost::optional<T>& var) noexcept {
106 bool has_data = var != boost::none;
109 if (p.isUnpacking()) {
118 template <
typename T>
119 inline void operator|(er& p, boost::optional<T>& var) noexcept {
Definition: Strahlkorper.hpp:14
Definition: BoostHelpers.hpp:53
Definition: BoostMultiArray.hpp:11
Definition: Determinant.hpp:11
typename detail::make_boost_variant_over_impl< tmpl::remove_duplicates< Sequence > >::type make_boost_variant_over
Create a boost::variant with all all the types inside the typelist Sequence.
Definition: BoostHelpers.hpp:51
Contains a pretty_type library to write types in a "pretty" format.
Wraps the template metaprogramming library used (brigand)
std::string type_of_current_state(const boost::variant< Ts... > &variant) noexcept
Get the type name of the current state of the boost::variant.
Definition: BoostHelpers.hpp:93
Defines type traits, some of which are future STL type_traits header.
A logical OR on the template parameters.
Definition: TypeTraits.hpp:145