26 #define USING_BOOST_VARIANT
29 #ifndef USING_BOOST_VARIANT
32 #include <boost/variant.hpp>
37 #ifndef USING_BOOST_VARIANT
41 using std::holds_alternative;
53 template<
typename... Args>
54 inline auto visit(Args&&... args)
59 template<
typename Ret,
typename... Types>
60 inline bool holds_alternative(
const boost::variant<Types...>& variant)
62 return boost::get<Ret>(&variant) !=
nullptr;
65 template<
typename Ret,
typename... Types>
66 inline Ret* get_if(boost::variant<Types...>* variant)
68 return boost::get<Ret>(variant);
71 template<
typename Ret,
typename... Types>
72 inline const Ret* get_if(
const boost::variant<Types...>* variant)
74 return boost::get<Ret>(variant);
79 template<
typename... Types>
82 #ifndef USING_BOOST_VARIANT
std::size_t variant_index(const variant< Types... > &var)
V::result_t apply_visitor(typename V::param_t state, T &&... args)
Helper function to apply the result of a specified visitor to a variable_info object.