選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

30 行
544 B

  1. #pragma once
  2. #include <cstddef>
  3. #include <type_traits>
  4. namespace utl {
  5. namespace mp {
  6. template<typename T>
  7. struct tag_const { };
  8. template<typename T, T t>
  9. struct integral_constant :
  10. public std::integral_constant<T, t>
  11. {
  12. using tag = tag_const<T>;
  13. };
  14. template<bool B>
  15. using c_bool = integral_constant<bool, B>;
  16. template<size_t S>
  17. using c_size_t = integral_constant<size_t, S>;
  18. using c_true = c_bool<true>;
  19. using c_false = c_bool<false>;
  20. using c_zero = c_size_t<0>;
  21. }
  22. }