calling non constexpr function from constexpr allowed in some conditions
Coming from that question: How to build a custom macro that behaves differently when used as constexpr (like assert)? I wonder why it is possible to call a non constexpr function if it is conditional. void bla( ) { std::cout << "bla called!" << std::endl; } constexpr bool check(bool condition) { //bla(); // can not directly be called -> not constexpr! condition ? void (0) : bla(); // compiles and runs even if condition is true or false! // if condition is const, it did not compile because it // directly force execution of non constexpr function true ? void(0): bla(); // also that compiles!, ok