> assert(x > 0 && "x was not greater than zero");
Shouldn't that be "||" rather than "&&"? We want the message only if the boolean expression is false.
Shouldn't that be "||" rather than "&&"? We want the message only if the boolean expression is false.
This works too (but I wouldn't recommend it):
assert( someBooleanExpression || ! "It is false" );