The conditional operator, also known as the ternary operator, is essentially an if statement in the form of an expression.
The operator is sequenced. The left side, with all its side effects, is evaluated first, followed by one of the right-side operands.
Before C++14, the ternary operator was the only way to inject logic into a constant-evaluated expression.
Compiler Explorer link: https://compiler-explorer.com/z/5shYvhsTa