Content deleted Content added
Line 672:
default: cbrt, \
float: cbrtf)(x)</syntaxhighlight>
This feature gives c [[Function overloading]] capabilities, but is not related to to generic programming. Generic programming can be achieve by using the proprocessor to define the generic code, with macro expansion taking the role of ''instantiation''. Sometimes the non standard extention statmente expressions is used:
<syntaxhighlight lang="c">
#define max(a,b) \
({ typeof (a) _a = (a); \
typeof (b) _b = (b); \
_a > _b ? _a : _b; })</syntaxhighlight>
==See also==
|