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