File indexing completed on 2025-01-18 09:40:48
0001 #ifndef BOOST_METAPARSE_V1_CPP14_IMPL_ANY_OF_C_HPP
0002 #define BOOST_METAPARSE_V1_CPP14_IMPL_ANY_OF_C_HPP
0003
0004
0005
0006
0007
0008
0009 #include <boost/mpl/bool.hpp>
0010
0011 namespace boost
0012 {
0013 namespace metaparse
0014 {
0015 namespace v1
0016 {
0017 namespace impl
0018 {
0019 template <char... Cs>
0020 struct any_of_c
0021 {
0022 typedef any_of_c type;
0023
0024 static constexpr bool run(char c_)
0025 {
0026 const bool values[] = {(c_ == Cs)...};
0027 for (const bool* i = values; i != values + sizeof...(Cs); ++i)
0028 {
0029 if (*i)
0030 {
0031 return true;
0032 }
0033 }
0034 return false;
0035 }
0036
0037 template <class Chr>
0038 struct apply : boost::mpl::bool_<any_of_c::run(Chr::type::value)> {};
0039 };
0040
0041 template <>
0042 struct any_of_c<>
0043 {
0044 typedef any_of_c type;
0045
0046 template <class>
0047 struct apply : boost::mpl::false_ {};
0048 };
0049 }
0050 }
0051 }
0052 }
0053
0054 #endif
0055