4 ms·
Sometimes I look at the way C macros are used to simulate generics and wonder to myself... Why don't y'all just put templates into the standard? If the way you'
by wsve 1y ago
Sometimes I look at the way C macros are used to simulate generics and wonder to myself... Why don't y'all just put templates into the standard? If the way you're writing C code is by badly imitating C++, then just imitate C++! There's no shame in it!
- jimbob45 1y agoC++ doesn’t force you to pay for anything you don’t use so you can just use the C++ compiler at that point and change the few incompatibilities between C and C++. That said…I agree that there is a lot of syntactic sugar that could be added for free to C.
- uecker 1y agoMaybe you could try to formulate it what sense this approach is actually inferior? IMHO it is superior to C++ templates by being far simpler.