constant.hpp 492 B

1234567891011121314151617181920212223242526
  1. /*
  2. Copyright 2018 Glen Joseph Fernandes
  3. ([email protected])
  4. Distributed under the Boost Software License, Version 1.0.
  5. (http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. #ifndef BOOST_TYPEOF_CONSTANT_HPP
  8. #define BOOST_TYPEOF_CONSTANT_HPP
  9. #include <boost/config.hpp>
  10. namespace boost {
  11. namespace type_of {
  12. template<class T, T N>
  13. struct constant {
  14. typedef constant<T, N> type;
  15. typedef constant<T, N + 1> next;
  16. BOOST_STATIC_CONSTANT(T, value=N);
  17. };
  18. } /* type_of */
  19. } /* boost */
  20. #endif