123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #ifndef BOOST_VARIANT_STATIC_VISITOR_HPP
- #define BOOST_VARIANT_STATIC_VISITOR_HPP
- #include <boost/config.hpp>
- #include <boost/detail/workaround.hpp>
- #include <boost/mpl/if.hpp>
- #include <boost/type_traits/is_base_and_derived.hpp>
- #include <boost/type_traits/integral_constant.hpp>
- #include <boost/mpl/aux_/lambda_support.hpp>
- namespace boost {
- namespace detail {
- struct is_static_visitor_tag { };
- typedef void static_visitor_default_return;
- }
- template <typename R = ::boost::detail::static_visitor_default_return>
- class static_visitor
- : public detail::is_static_visitor_tag
- {
- public:
- typedef R result_type;
- protected:
- #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
- static_visitor() = default;
- #else
- static_visitor() BOOST_NOEXCEPT { }
- #endif
- };
- namespace detail {
- template <typename T>
- struct is_static_visitor_impl
- {
- BOOST_STATIC_CONSTANT(bool, value =
- (::boost::is_base_and_derived<
- detail::is_static_visitor_tag,
- T
- >::value));
- };
- }
- template< typename T > struct is_static_visitor
- : public ::boost::integral_constant<bool,(::boost::detail::is_static_visitor_impl<T>::value)>
- {
- public:
- BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_static_visitor,(T))
- };
- }
- #endif
|