I need to implement self contained compile-time function for checking type equality (function template without arguments bool eqTypes()).
bool eqTypes()
sel
Here's how you can do it in C, without any magic GCC extensions:
#define CHECKED_TYPE(original_type, p) ((conversion_type*) (1 ? p : (original_type*) 0))
E.g:
void *q = CHECKED_TYPE(int, &y);
Will trigger a compile error if y is not int. For explanation, see here.
y
int