Loading...
Searching...
No Matches
Go to the documentation of this file.
5#if defined DC_GENERIC_KEYWORD_SUPPORTED
6 #define DC_REQUIRE_FUNCTION(ret, func, args) _Generic(func, ret(*) args: 1, default: 0)
7 #define DC_REQUIRE_CONSTANT_TYPE_EXPR(obj, name, Type) \
8 _Generic((NS(obj, name)), Type: 1, default: 0)
10 #include <type_traits>
11 #define DC_REQUIRE_FUNCTION(ret, func, args) std::is_same_v<decltype(+func), ret(*) args>
12 #define DC_REQUIRE_CONSTANT_TYPE_EXPR(obj, name, Type) \
13 std::is_same_v<std::remove_cv_t<std::remove_reference_t<decltype(NS(obj, name))>>, Type>
16#define DC_REQUIRE_METHOD(ret, obj, name, args) \
17 DC_STATIC_ASSERT(DC_REQUIRE_FUNCTION(ret, NS(obj, name), args), \
18 "Method " #obj "." #name " must exist with type " #ret " (*)" #args)
23#define DC_REQUIRE_TYPE(obj, name) DC_STATIC_ASSERT(sizeof(NS(obj, name)) + 1)
25#define DC_REQUIRE_CONSTANT(obj, name, type) \
26 DC_STATIC_ASSERT(DC_REQUIRE_CONSTANT_TYPE_EXPR(obj, name, type), \
27 "Method " #obj "." #name " must exist and be of type " #type)