3 ms·
Why use macros instead of inline functions?
by saagarjha 4y ago
Why use macros instead of inline functions?
- vore 4y agoInline functions can't be made type safe (or at least, as type safe as C gets) over generic arrays.
- flohofwoe 4y agoBecause the API needs to work for random item types. C doesn't have templates (and for stuff like this C11's _Generic isn't helpful because that just maps specialized function names to generic function names, but doesn't help with the generic implementation code).