2 ms·
The compiler is a series of such scripts. With constexpr/consteval/constinit, templates, and reflection, C++ is slowly converging on hygienic macros. Also "a
by MathMonkeyMan 2y ago
The compiler is a series of such scripts. With constexpr/consteval/constinit, templates, and reflection, C++ is slowly converging on hygienic macros.
Also "a computation is not and cannot be constant" depends on what is meant precisely by "computation" and "constant." Is "23 * 48" a constant, or is it a computation? What about "2208/2"? What about "1.104e3"?
You can define "constant" as "something that is not computed but that exists in the program as an immediate value." In that case you're right but only by definition. And the compiler must still "interpret" the immediate value. It's a slightly fuzzy distinction in my eyes.