4 ms·
The point is that using macros for constants is frowned upon in modern codebases, just like all other use cases for macros that break type safety and the one de
by qppo 6y ago
The point is that using macros for constants is frowned upon in modern codebases, just like all other use cases for macros that break type safety and the one definition rule.
- asveikau 6y agoYes, I understand the point. But to your comment in a literal sense, if I were doing code review I would probably suggest using M_PI. Which happens to be a macro. Which actually highlights that many things you want to use for practical purposes are C rather than C++, predate innovations such as const or namespaces, etc. It's possible and common to understand the downsides and still reach for the macro.