I am implementing functionality that provides the opportunity to translate the coordinates of the cells of the game board to the number of this cell.
This is what I\'m t
The ternary conditional in this case is not equivalent to if
statement because it is a constexpr if
statement.
With constexpr if
statement,
If a
constexpr if
statement appears inside a templated entity, and if condition is not value-dependent after instantiation, the discarded statement is not instantiated when the enclosing template is instantiated .
But with the ternary conditional, the templates are always instantiated. This leads to infinite recursion.
Note that if you replace the constexpr if
with normal if
you get the same error.
See DEMO.