4 ms·
The "big bug" indeed limits the possibilities of _Generic. But if you really want to abuse it beyond its intended scope, I think you can simply add some casting
by teo_zero 3y ago
The "big bug" indeed limits the possibilities of _Generic. But if you really want to abuse it beyond its intended scope, I think you can simply add some casting, and not the gimmicks with nested _Generic.
#define length(x) _Generic(x, \
char * : strlen((char*)(x)), \
String * : ((String*)(x))->len \
)