On 08/02/2014 08:40 AM, Andrew Godfrey wrote:
So even if the assertion is incorrect and the code is correct, the caller's correctness can be compromised?
Yes. The reasoning is that if the assertion is incorrect, the program is fundamentally broken, it enters an invalid state and hence it is fair game to make the behaviour undefined.
This seems impractical. As in, no one will in good conscience turn it on, except when their program is very small.
That was my reasoning as well, but it wasn't universally agreed with.