range.hpp 816 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef BOOST_METAPARSE_V1_RANGE_HPP
  2. #define BOOST_METAPARSE_V1_RANGE_HPP
  3. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2014.
  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/accept_when.hpp>
  8. #include <boost/metaparse/v1/one_char.hpp>
  9. #include <boost/metaparse/v1/util/in_range_c.hpp>
  10. #include <boost/metaparse/v1/error/unexpected_character.hpp>
  11. namespace boost
  12. {
  13. namespace metaparse
  14. {
  15. namespace v1
  16. {
  17. template <class From, class To>
  18. struct range :
  19. accept_when<
  20. one_char,
  21. util::in_range_c<char, From::type::value, To::type::value>,
  22. error::unexpected_character
  23. >
  24. {};
  25. }
  26. }
  27. }
  28. #endif