one_of_c.hpp 852 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef BOOST_METAPARSE_V1_CPP14_ONE_OF_C_HPP
  2. #define BOOST_METAPARSE_V1_CPP14_ONE_OF_C_HPP
  3. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2017.
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. #include <boost/metaparse/v1/one_char.hpp>
  8. #include <boost/metaparse/v1/accept_when.hpp>
  9. #include <boost/metaparse/v1/error/none_of_the_expected_cases_found.hpp>
  10. #include <boost/metaparse/v1/cpp14/impl/any_of_c.hpp>
  11. #include <boost/mpl/eval_if.hpp>
  12. namespace boost
  13. {
  14. namespace metaparse
  15. {
  16. namespace v1
  17. {
  18. template <char... Cs>
  19. struct one_of_c :
  20. accept_when<
  21. one_char,
  22. impl::any_of_c<Cs...>,
  23. error::none_of_the_expected_cases_found
  24. >
  25. {};
  26. }
  27. }
  28. }
  29. #endif