1 #ifndef BOOST_METAPARSE_V1_IMPL_IS_ANY_HPP
2 #define BOOST_METAPARSE_V1_IMPL_IS_ANY_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/metaparse/limit_one_char_except_size.hpp>
11 #include <boost/mpl/eval_if.hpp>
12 #include <boost/mpl/bool.hpp>
14 #include <boost/preprocessor/cat.hpp>
15 #include <boost/preprocessor/arithmetic/dec.hpp>
16 #include <boost/preprocessor/repetition/enum_params.hpp>
17 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
27 template <class Stub = int>
31 struct apply : boost::mpl::true_ {};
34 #ifdef BOOST_METAPARSE_DEFINE_IS_ANY
35 # error BOOST_METAPARSE_DEFINE_IS_ANY already defined
37 #define BOOST_METAPARSE_DEFINE_IS_ANY(z, n, unused) \
38 template <BOOST_PP_ENUM_PARAMS(n, class T)> \
39 struct BOOST_PP_CAT(is_any, n) \
43 boost::mpl::eval_if< \
46 == BOOST_PP_CAT(T, BOOST_PP_DEC(n))::type::value \
49 typename BOOST_PP_CAT(is_any, BOOST_PP_DEC(n))< \
50 BOOST_PP_ENUM_PARAMS(BOOST_PP_DEC(n), T) \
51 >::template apply<C> \
56 BOOST_PP_REPEAT_FROM_TO(
58 BOOST_METAPARSE_LIMIT_ONE_CHAR_EXCEPT_SIZE,
59 BOOST_METAPARSE_DEFINE_IS_ANY,
63 #undef BOOST_METAPARSE_DEFINE_IS_ANY