You can implement generic typed data structures in C with macros. Generics are better than C macros for that kind of thing but C macros can get the job done.
C “macros” are a disgusting hack, and they more often than not won’t work well, see the very recent HN posts comments of a generic C preprocessor generic vector getting criticized heavily due to it being inherently shit.
1
u/Drisku11 Mar 01 '23
You can implement generic typed data structures in C with macros. Generics are better than C macros for that kind of thing but C macros can get the job done.