Relative Content

Tag Archive for c++if-statementconstexpr

Multiple use constexpr if [duplicate]

This question already has answers here: Extend object lifetime/scope from a `if constexpr` branch (2 answers) Scope of variables declared inside `if constexpr` blocks (2 answers) Closed 28 mins ago. I have a problem with multiple use constexpr C++17. #include <iostream> int main() { static constexpr bool condition_a = true; if constexpr (condition_a) { // […]

Multiple use constexpr if [duplicate]

This question already has answers here: Extend object lifetime/scope from a `if constexpr` branch (2 answers) Scope of variables declared inside `if constexpr` blocks (2 answers) Closed 2 mins ago. I have a problem with multiple use constexpr C++17. #include <iostream> int main() { static constexpr bool condition_a = true; if constexpr (condition_a) { // […]