in_range_c.hpp 834 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef BOOST_METAPARSE_V1_UTIL_IN_RANGE_C_HPP
  2. #define BOOST_METAPARSE_V1_UTIL_IN_RANGE_C_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/mpl/bool.hpp>
  8. namespace boost
  9. {
  10. namespace metaparse
  11. {
  12. namespace v1
  13. {
  14. namespace util
  15. {
  16. template <class T, T LowerBound, T UpperBound>
  17. struct in_range_c
  18. {
  19. typedef in_range_c type;
  20. template <class Item>
  21. struct apply :
  22. boost::mpl::bool_<(
  23. LowerBound <= Item::type::value
  24. && Item::type::value <= UpperBound
  25. )>
  26. {};
  27. };
  28. }
  29. }
  30. }
  31. }
  32. #endif