4 ms·
I mean, C11 also has generics, but I would really suggest not using it X). See https://en.cppreference.com/w/c/language/generic https://en.cppreference.com/w/c/
by roblabla 5y ago
I mean, C11 also has generics, but I would really suggest not using it X). See https://en.cppreference.com/w/c/language/generic https://en.cppreference.com/w/c/language/generic
Of couse, it's a much less powerful feature, there's nothing like interfaces or stuff, just a way to "overload" based on the type.
- yisonPylkita 5y agoThank you. I had no idea that you could do such a thing in C11 preprocessor
- flohofwoe 5y ago_Generic() is not a preprocessor feature, but a "real" language feature (I was confused too when I saw it first though). The only preprocessor part in the example is mapping the function-like macro 'cbrt(X)' to the language keyword '_Generic(X)'.