P99
|
◆ P99_GENERIC_PQUALIFIED
Value:
P99_GENERIC( \
/* The second case is subtle. If we would chose (void*)0 */ \
/* this would be a null pointer constant and the return */ \
/* type would be the type of PEXP. If it is another type */ \
/* of void* expression the return is a qualified version */ \
/* of void*. */ \
(1 ? (PEXP) : (void*)1),, \
P00_VOIDIFY_LIST(__VA_ARGS__))
Generic choice based on the qualification of the target of a pointer expression. This can be used to choose a different function to call if the target of a pointer expression is qualified or not. If we suppose that for a certain task we want to distinguish P99_GENERIC_PQUALIFIED((PEXP),
(, myfunc_),
(const, myfunc_c),
(volatile, myfunc_v),
(const volatile, myfunc_cv))
(PEXP)
Or if we want the qualification of a return expression to match the qualification of the target of an input expression P99_GENERIC_PQUALIFIED(toto,
(, tutu),
(const, (tutu_type const*)tutu),
(volatile, (tutu_type volatile*)tutu),
(const volatile, (tutu_type const volatile*)tutu)
)
Definition at line 1554 of file p99_generic.h. |