|
|
|
|
|
by TorKlingberg
4387 days ago
|
|
Yes, C doesn't have generics. In practice most C code uses the fourth version, and you just have to remember not to put things with side effects as macro arguments. #define MIN(a, b) ((a) < (b) ? (a) : (b)) C11 does introduce very limited type-variant macros. |
|
Though you do have to name mangle manually and they aren't quite as powerful as you'd probably want.
http://www.robertgamble.net/2012/01/c11-generic-selections.h...