File indexing completed on 2025-01-18 09:40:48
0001 #ifndef BOOST_METAPARSE_V1_CPP98_IMPL_IS_NONE_HPP
0002 #define BOOST_METAPARSE_V1_CPP98_IMPL_IS_NONE_HPP
0003
0004
0005
0006
0007
0008
0009 #include <boost/metaparse/limit_one_char_except_size.hpp>
0010
0011 #include <boost/mpl/eval_if.hpp>
0012 #include <boost/mpl/bool.hpp>
0013
0014 #include <boost/preprocessor/cat.hpp>
0015 #include <boost/preprocessor/arithmetic/dec.hpp>
0016 #include <boost/preprocessor/repetition/enum_params.hpp>
0017 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
0018
0019 namespace boost
0020 {
0021 namespace metaparse
0022 {
0023 namespace v1
0024 {
0025 namespace impl
0026 {
0027 template <class Stub = int>
0028 struct is_none0
0029 {
0030 template <class C>
0031 struct apply : boost::mpl::true_ {};
0032 };
0033
0034 #ifdef BOOST_METAPARSE_DEFINE_IS_NONE
0035 # error BOOST_METAPARSE_DEFINE_IS_NONE already defined
0036 #endif
0037 #define BOOST_METAPARSE_DEFINE_IS_NONE(z, n, unused) \
0038 template <BOOST_PP_ENUM_PARAMS(n, class T)> \
0039 struct BOOST_PP_CAT(is_none, n) \
0040 { \
0041 template <class C> \
0042 struct apply : \
0043 boost::mpl::eval_if< \
0044 boost::mpl::bool_< \
0045 C::type::value \
0046 == BOOST_PP_CAT(T, BOOST_PP_DEC(n))::type::value \
0047 >, \
0048 boost::mpl::false_, \
0049 typename BOOST_PP_CAT(is_none, BOOST_PP_DEC(n))< \
0050 BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(n), T) \
0051 >::template apply<C> \
0052 > \
0053 {}; \
0054 };
0055
0056 BOOST_PP_REPEAT_FROM_TO(
0057 1,
0058 BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
0059 BOOST_METAPARSE_DEFINE_IS_NONE,
0060 ~
0061 )
0062
0063 #undef BOOST_METAPARSE_DEFINE_IS_NONE
0064 }
0065 }
0066 }
0067 }
0068
0069 #endif
0070