|
|
|
|
|
by proverbialbunny
2163 days ago
|
|
>I use C++ at work, ..., and macros are used quite a bit in the code base. Ouch. Modern C++ has alternatives to C macros. Is it an old code base, or is it just written in the C++98 style? Today people will typically use constexpr instead of #define. While macros can possibly do some funky things constexpr can't, you'd be hard pressed to find those things. (C++ supports constexpr if, constexpr functions, constexpr lambdas, math, and so on.) If you have the time and effort, it may be worthwhile to slowly start modernizing the code base, bit by bit. The advantage of modern day C++ is it catches errors at compile time that older versions did not and would crash while the software was running. You might improve the stability of the code base if you help out. |
|