4.14 — Compile-time constants, constant expressions, and constexpr
Consider the following short program: #include <iostream> int main() { std::cout << 3 + 4; return 0; } The output is straightforward: 7 However, there’s an interesting optimization possibility hidden within. If this program were compiled as it was written, the compiler would generate an executable that calculates the result …