Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

137 Zeilen
4.9 KiB

  1. #pragma once
  2. #define cppmp_define_checker(name) \
  3. template<typename... T> \
  4. struct name \
  5. : public integral_constant<decltype(std::name<T...>::value), std::name<T...>::value> \
  6. { }; \
  7. \
  8. template<typename... T> \
  9. constexpr decltype(auto) name ## _v = name<T...>::value;
  10. #include "types.h"
  11. namespace cppmp
  12. {
  13. /**
  14. * @brief Evaluates to true_t if the passed template parameters are valid, false_t otherwise.
  15. */
  16. template<typename...>
  17. struct is_valid;
  18. /**
  19. * @brief Is true if the passed template parameters are valid, false otherwise.
  20. */
  21. template<typename... T>
  22. constexpr decltype(auto) is_valid_v = is_valid<T...>::value;
  23. /**
  24. * @brief Evaluates to true_t if T is a specialization if T_template, false_t otherwise.
  25. */
  26. template<typename T, template <typename...> class T_template>
  27. struct is_specialization_of;
  28. /**
  29. * @brief Evaluates to true if T is a specialization if T_template, false otherwise.
  30. */
  31. template<typename T, template <typename...> class T_template>
  32. constexpr decltype(auto) is_specialization_of_v = is_specialization_of<T, T_template>::value;
  33. /**
  34. * @brief Evaluates to true_t if all passed parameters are true, false_t otherwise.
  35. */
  36. template<bool... B>
  37. struct is_true;
  38. /**
  39. * @brief Evaluates to true if all passed parameters are true, false otherwise.
  40. */
  41. template<bool... B>
  42. constexpr decltype(auto) is_true_v = is_true<B...>::value;
  43. cppmp_define_checker(is_void);
  44. cppmp_define_checker(is_null_pointer);
  45. cppmp_define_checker(is_integral);
  46. cppmp_define_checker(is_floating_point);
  47. cppmp_define_checker(is_array);
  48. cppmp_define_checker(is_enum);
  49. cppmp_define_checker(is_union);
  50. cppmp_define_checker(is_class);
  51. cppmp_define_checker(is_function);
  52. cppmp_define_checker(is_pointer);
  53. cppmp_define_checker(is_lvalue_reference);
  54. cppmp_define_checker(is_rvalue_reference);
  55. cppmp_define_checker(is_member_object_pointer);
  56. cppmp_define_checker(is_member_function_pointer);
  57. cppmp_define_checker(is_fundamental);
  58. cppmp_define_checker(is_arithmetic);
  59. cppmp_define_checker(is_scalar);
  60. cppmp_define_checker(is_object);
  61. cppmp_define_checker(is_compound);
  62. cppmp_define_checker(is_reference);
  63. cppmp_define_checker(is_member_pointer);
  64. cppmp_define_checker(is_const);
  65. cppmp_define_checker(is_volatile);
  66. cppmp_define_checker(is_trivial);
  67. cppmp_define_checker(is_trivially_copyable);
  68. cppmp_define_checker(is_standard_layout);
  69. cppmp_define_checker(is_pod);
  70. cppmp_define_checker(is_literal_type);
  71. cppmp_define_checker(is_empty);
  72. cppmp_define_checker(is_polymorphic);
  73. cppmp_define_checker(is_abstract);
  74. cppmp_define_checker(is_final);
  75. cppmp_define_checker(is_signed);
  76. cppmp_define_checker(is_unsigned);
  77. cppmp_define_checker(is_constructible);
  78. cppmp_define_checker(is_trivially_constructible);
  79. cppmp_define_checker(is_nothrow_constructible);
  80. cppmp_define_checker(is_default_constructible);
  81. cppmp_define_checker(is_trivially_default_constructible);
  82. cppmp_define_checker(is_nothrow_default_constructible);
  83. cppmp_define_checker(is_copy_constructible);
  84. cppmp_define_checker(is_trivially_copy_constructible);
  85. cppmp_define_checker(is_nothrow_copy_constructible);
  86. cppmp_define_checker(is_move_constructible);
  87. cppmp_define_checker(is_trivially_move_constructible);
  88. cppmp_define_checker(is_nothrow_move_constructible);
  89. cppmp_define_checker(is_assignable);
  90. cppmp_define_checker(is_trivially_assignable);
  91. cppmp_define_checker(is_nothrow_assignable);
  92. cppmp_define_checker(is_copy_assignable);
  93. cppmp_define_checker(is_trivially_copy_assignable);
  94. cppmp_define_checker(is_nothrow_copy_assignable);
  95. cppmp_define_checker(is_move_assignable);
  96. cppmp_define_checker(is_trivially_move_assignable);
  97. cppmp_define_checker(is_nothrow_move_assignable);
  98. cppmp_define_checker(is_destructible);
  99. cppmp_define_checker(is_trivially_destructible);
  100. cppmp_define_checker(is_nothrow_destructible);
  101. cppmp_define_checker(has_virtual_destructor);
  102. cppmp_define_checker(is_swappable_with);
  103. cppmp_define_checker(is_swappable);
  104. cppmp_define_checker(is_nothrow_swappable_with);
  105. cppmp_define_checker(is_nothrow_swappable);
  106. cppmp_define_checker(alignment_of);
  107. cppmp_define_checker(rank);
  108. cppmp_define_checker(extent);
  109. cppmp_define_checker(is_same);
  110. cppmp_define_checker(is_base_of);
  111. cppmp_define_checker(is_convertible);
  112. #if __cplusplus >= 201703L
  113. cppmp_define_checker(has_unique_object_representations);
  114. cppmp_define_checker(is_aggregate);
  115. cppmp_define_checker(is_invocable);
  116. cppmp_define_checker(is_invocable_r);
  117. cppmp_define_checker(is_nothrow_invocable);
  118. cppmp_define_checker(is_nothrow_invocable_r);
  119. #endif
  120. }
  121. #undef cppmp_define_checker
  122. #include "checker.inl"