integral.hpp 999 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef BHO_MP11_INTEGRAL_HPP_INCLUDED
  2. #define BHO_MP11_INTEGRAL_HPP_INCLUDED
  3. // Copyright 2015 Peter Dimov.
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. //
  7. // See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt
  9. #include <asio2/bho/mp11/version.hpp>
  10. #include <asio2/bho/mp11/detail/mp_value.hpp>
  11. #include <type_traits>
  12. #include <cstddef>
  13. namespace bho
  14. {
  15. namespace mp11
  16. {
  17. // mp_bool
  18. template<bool B> using mp_bool = std::integral_constant<bool, B>;
  19. using mp_true = mp_bool<true>;
  20. using mp_false = mp_bool<false>;
  21. // mp_to_bool
  22. template<class T> using mp_to_bool = mp_bool<static_cast<bool>( T::value )>;
  23. // mp_not<T>
  24. template<class T> using mp_not = mp_bool< !T::value >;
  25. // mp_int
  26. template<int I> using mp_int = std::integral_constant<int, I>;
  27. // mp_size_t
  28. template<std::size_t N> using mp_size_t = std::integral_constant<std::size_t, N>;
  29. } // namespace mp11
  30. } // namespace bho
  31. #endif // #ifndef BHO_MP11_INTEGRAL_HPP_INCLUDED