Re:Type-erased generic functions for C: A modest non-proposal
by kazinator on Friday October 04, 2024 @03:49PM
(#41744973)
C has generic selection via _Generic. You just have to write your generic function as a macro which uses that in its expansion. It has limitations. It's powerful enough though that for example in the current draft C, I believe, functions like strchr are now overloaded such that if the argument is const char *, you get the const-qualified return type, otherwise plain. There's a header of type generic math as well.
[ Parent
| on HN ]
There are no comments on this comment yet.