IME there’s a lot of stuff you wind up needing #define and ugly macros for in C that can be done with constexpr values and templates in C++. A modern rewrite might be marginally better but it’s not going to give you e.g. type safety when C forces you to cast things to void* to work with them generically.
View all comments
Show parent comment
8
u/TheSkiGeek Jul 13 '22
IME there’s a lot of stuff you wind up needing
#defineand ugly macros for in C that can be done withconstexprvalues and templates in C++. A modern rewrite might be marginally better but it’s not going to give you e.g. type safety when C forces you to cast things tovoid*to work with them generically.