4 ms·
C has generics as well. This permits the return type of generic functions to be preserved.
by kevin_thibedeau 3y ago
C has generics as well. This permits the return type of generic functions to be preserved.
- jcranmer 3y agoThe only generic feature C has is the _Generic expression, which isn't a function, but closer to a switch(typeof(x)) expression.
- kevin_thibedeau 3y ago_Generic can be used to merge a collection of functions.
- CyberDildonics 3y agoThat's not the same as being able to write a data structure that takes any type.
- kevin_thibedeau 3y agoIt's still generic. You don't have to have feature parity with C++ to meet that bar.
- CyberDildonics 3y agoThat would be like calling function overloading generics.
- neutrono 3y agoIt should have been called _Overload or something similar, since it's not really a generic.