3 ms·
I think you've misunderstood the purpose of _Generic. Your #if statement will select exactly one implementation for every single site of the use of LENGTH() in
by kelnos 3y ago
I think you've misunderstood the purpose of _Generic.
Your #if statement will select exactly one implementation for every single site of the use of LENGTH() in the codebase, depending on the value of X_MIGHT_BE_MYSTRINGBUFFER at compile-time.
_Generic() allows you to have both implementations available, and different implementations can be selected at the call site depending on the type of the argument passed.