3 ms·
There is a mixup here between different flavours of polymorphism. _Generic does ad-hoc polymorphism via type-based dispatch in order to implement function over
by fanf2 3y ago
There is a mixup here between different flavours of polymorphism.
_Generic does ad-hoc polymorphism via type-based dispatch in order to implement function overloading.
Macros are more like a limited form of parametric polymorphism, in that they are polymorphic up to what is allowed by the operations they apply to their arguments. In C that typically means relying on implicit or explicit coercions, or C’s mildly overloaded operators.