"I just found out that the rounding behavior of the division operator was not defined before C ++ 11." This is not so if both arguments are positive integers.
3 / 2 == 1is an expression of a compile-time constant with a value true, so the code will compile as assert(true).
Consider using static_assertcompiler time assertions.
source
share