On Fri, 4 Aug 2023 15:40:30 +0200 Alejandro Colomar <a...@kernel.org> wrote:
> I also dislike the idea of C++ deprecating macros. IMO, they had to > do it because they bloated the language so much with dubious features > that make macros (and other C features) be unsafe. The need for macros in C++ is greatly diminished by templates. Unlike macros, templates compile. That gives them geniune safety. Like macros, they must be written correctly. Unlike macros, they're checked by the compiler. Replacing macros with templates was and is a goal of introducing templates into the language. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-macros2 --jkl