Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

- C has its own syntax for generics

C has generics?



Nothing like C++ or Rust generics. C has _Generic (type-switch macro): https://en.cppreference.com/w/c/language/generic

Go into pointer qualifiers and const with _Generic and you'll see that it's a mess to do anything serious with it. But it's handy for type-generic math (tgmath.h style) and that's seems to be about it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: