|
- #pragma once
-
- #include "types.h"
- #include "../config.h"
-
-
- #define cppmp_define_checker(name) \
- template<typename... T> \
- struct name \
- : public integral_constant<decltype(std::name<T...>::value), std::name<T...>::value> \
- { }; \
- \
- cppmp_define_checker_var(name)
-
- #ifdef cppmp_supports_variable_templates
- #define cppmp_define_checker_var(name) \
- template<typename... T> \
- constexpr decltype(auto) name ## _v = name<T...>::value;
- #else
- #define cppmp_define_checker_var(name)
- #endif
-
- namespace cppmp
- {
-
- namespace __impl
- {
-
- template<typename T>
- struct is_valid;
-
- }
-
- /**
- * @brief Evaluates to true_t if the passed template parameters are valid, false_t otherwise.
- */
- template<typename T>
- struct is_valid
- : public __impl::is_valid<T>
- { };
-
- cppmp_define_checker_var(is_valid)
-
- /**
- * @brief Evaluates to true_t if T is a specialization if T_template, false_t otherwise.
- */
- template<typename T, template <typename...> class T_template>
- struct is_specialization_of;
-
- #ifdef cppmp_supports_variable_templates
- template<typename T, template <typename...> class T_template>
- constexpr decltype(auto) is_specialization_of_v = is_specialization_of<T, T_template>::value;
- #endif
-
- /**
- * @brief Evaluates to true_t if all passed parameters are true, false_t otherwise.
- */
- template<bool... B>
- struct is_true;
-
- #ifdef cppmp_supports_variable_templates
- template<bool... B>
- constexpr decltype(auto) is_true_v = is_true<B...>::value;
- #endif
-
- /* primary type categories */
-
- #ifdef cppmp_std_supports_is_void
- cppmp_define_checker(is_void);
- #endif
-
- #ifdef cppmp_std_supports_is_null_pointer
- cppmp_define_checker(is_null_pointer);
- #endif
-
- #ifdef cppmp_std_supports_is_integral
- cppmp_define_checker(is_integral);
- #endif
-
- #ifdef cppmp_std_supports_is_floating_point
- cppmp_define_checker(is_floating_point);
- #endif
-
- #ifdef cppmp_std_supports_is_array
- cppmp_define_checker(is_array);
- #endif
-
- #ifdef cppmp_std_supports_is_pointer
- cppmp_define_checker(is_pointer);
- #endif
-
- #ifdef cppmp_std_supports_is_lvalue_reference
- cppmp_define_checker(is_lvalue_reference);
- #endif
-
- #ifdef cppmp_std_supports_is_rvalue_reference
- cppmp_define_checker(is_rvalue_reference);
- #endif
-
- #ifdef cppmp_std_supports_is_member_object_pointer
- cppmp_define_checker(is_member_object_pointer);
- #endif
-
- #ifdef cppmp_std_supports_is_member_function_pointer
- cppmp_define_checker(is_member_function_pointer);
- #endif
-
- #ifdef cppmp_std_supports_is_enum
- cppmp_define_checker(is_enum);
- #endif
-
- #ifdef cppmp_std_supports_is_union
- cppmp_define_checker(is_union);
- #endif
-
- #ifdef cppmp_std_supports_is_class
- cppmp_define_checker(is_class);
- #endif
-
- #ifdef cppmp_std_supports_is_function
- cppmp_define_checker(is_function);
- #endif
-
-
- /* composite type categories */
-
- #ifdef cppmp_std_supports_is_reference
- cppmp_define_checker(is_reference);
- #endif
-
- #ifdef cppmp_std_supports_is_arithmetic
- cppmp_define_checker(is_arithmetic);
- #endif
-
- #ifdef cppmp_std_supports_is_fundamental
- cppmp_define_checker(is_fundamental);
- #endif
-
- #ifdef cppmp_std_supports_is_object
- cppmp_define_checker(is_object);
- #endif
-
- #ifdef cppmp_std_supports_is_scalar
- cppmp_define_checker(is_scalar);
- #endif
-
- #ifdef cppmp_std_supports_is_compound
- cppmp_define_checker(is_compound);
- #endif
-
- #ifdef cppmp_std_supports_is_member_pointer
- cppmp_define_checker(is_member_pointer);
- #endif
-
- /* type properties */
-
- #ifdef cppmp_std_supports_is_const
- cppmp_define_checker(is_const);
- #endif
-
- #ifdef cppmp_std_supports_is_volatile
- cppmp_define_checker(is_volatile);
- #endif
-
- #ifdef cppmp_std_supports_is_trivial
- cppmp_define_checker(is_trivial);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_copyable
- cppmp_define_checker(is_trivially_copyable);
- #endif
-
- #ifdef cppmp_std_supports_is_standard_layout
- cppmp_define_checker(is_standard_layout);
- #endif
-
- #ifdef cppmp_std_supports_is_pod
- cppmp_define_checker(is_pod);
- #endif
-
- #ifdef cppmp_std_supports_is_empty
- cppmp_define_checker(is_empty);
- #endif
-
- #ifdef cppmp_std_supports_is_polymorphic
- cppmp_define_checker(is_polymorphic);
- #endif
-
- #ifdef cppmp_std_supports_is_abstract
- cppmp_define_checker(is_abstract);
- #endif
-
- #ifdef cppmp_std_supports_is_final
- cppmp_define_checker(is_final);
- #endif
-
- #ifdef cppmp_std_supports_is_aggregate
- cppmp_define_checker(is_aggregate);
- #endif
-
- #ifdef cppmp_std_supports_is_signed
- cppmp_define_checker(is_signed);
- #endif
-
- #ifdef cppmp_std_supports_is_unsigned
- cppmp_define_checker(is_unsigned);
- #endif
-
- #ifdef cppmp_std_supports_is_bounded_array
- cppmp_define_checker(is_bounded_array);
- #endif
-
- #ifdef cppmp_std_supports_is_unbounded_array
- cppmp_define_checker(is_unbounded_array);
- #endif
-
- #ifdef cppmp_std_supports_is_constructible
- cppmp_define_checker(is_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_default_constructible
- cppmp_define_checker(is_default_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_copy_constructible
- cppmp_define_checker(is_copy_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_move_constructible
- cppmp_define_checker(is_move_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_assignable
- cppmp_define_checker(is_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_copy_assignable
- cppmp_define_checker(is_copy_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_move_assignable
- cppmp_define_checker(is_move_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_swappable_with
- cppmp_define_checker(is_swappable_with);
- #endif
-
- #ifdef cppmp_std_supports_is_swappable
- cppmp_define_checker(is_swappable);
- #endif
-
- #ifdef cppmp_std_supports_is_destructible
- cppmp_define_checker(is_destructible);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_constructible
- cppmp_define_checker(is_trivially_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_default_constructible
- cppmp_define_checker(is_trivially_default_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_copy_constructible
- cppmp_define_checker(is_trivially_copy_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_move_constructible
- cppmp_define_checker(is_trivially_move_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_assignable
- cppmp_define_checker(is_trivially_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_copy_assignable
- cppmp_define_checker(is_trivially_copy_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_move_assignable
- cppmp_define_checker(is_trivially_move_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_trivially_destructible
- cppmp_define_checker(is_trivially_destructible);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_constructible
- cppmp_define_checker(is_nothrow_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_default_constructible
- cppmp_define_checker(is_nothrow_default_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_copy_constructible
- cppmp_define_checker(is_nothrow_copy_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_move_constructible
- cppmp_define_checker(is_nothrow_move_constructible);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_assignable
- cppmp_define_checker(is_nothrow_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_copy_assignable
- cppmp_define_checker(is_nothrow_copy_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_move_assignable
- cppmp_define_checker(is_nothrow_move_assignable);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_swappable_with
- cppmp_define_checker(is_nothrow_swappable_with);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_swappable
- cppmp_define_checker(is_nothrow_swappable);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_destructible
- cppmp_define_checker(is_nothrow_destructible);
- #endif
-
- #ifdef cppmp_std_supports_has_virtual_destructor
- cppmp_define_checker(has_virtual_destructor);
- #endif
-
- #ifdef cppmp_std_supports_has_unique_object_representations
- cppmp_define_checker(has_unique_object_representations);
- #endif
-
- #ifdef cppmp_std_supports_has_strong_structural_equality
- cppmp_define_checker(has_strong_structural_equality);
- #endif
-
- /* type property queries */
-
- #ifdef cppmp_std_supports_alignment_of
- cppmp_define_checker(alignment_of);
- #endif
-
- #ifdef cppmp_std_supports_rank
- cppmp_define_checker(rank);
- #endif
-
- #ifdef cppmp_std_supports_extent
- cppmp_define_checker(extent);
- #endif
-
- /* type relations */
-
- #ifdef cppmp_std_supports_is_same
- cppmp_define_checker(is_same);
- #endif
-
- #ifdef cppmp_std_supports_is_base_of
- cppmp_define_checker(is_base_of);
- #endif
-
- #ifdef cppmp_std_supports_is_convertible
- cppmp_define_checker(is_convertible);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_convertible
- cppmp_define_checker(is_nothrow_convertible);
- #endif
-
- #ifdef cppmp_std_supports_is_layout_compatible
- cppmp_define_checker(is_layout_compatible);
- #endif
-
- #ifdef cppmp_std_supports_is_pointer_interconvertible_base_of
- cppmp_define_checker(is_pointer_interconvertible_base_of);
- #endif
-
- #ifdef cppmp_std_supports_is_invocable
- cppmp_define_checker(is_invocable);
- #endif
-
- #ifdef cppmp_std_supports_is_invocable_r
- cppmp_define_checker(is_invocable_r);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_invocable
- cppmp_define_checker(is_nothrow_invocable);
- #endif
-
- #ifdef cppmp_std_supports_is_nothrow_invocable_r
- cppmp_define_checker(is_nothrow_invocable_r);
- #endif
-
- }
-
- #undef cppmp_define_checker
- #undef cppmp_define_checker_var
-
- #include "checker.inl"
|