Asserts that the given value is true, but unlike standard assert throws an exception on error.
The value to test.
The exception to throw if the value evaluates to false.
value, if cast(bool)value is true. Otherwise, ex is thrown.
auto f = asserte(fopen("data.txt")); auto line = readln(f); asserte(line.length, new IOException); // expect a non-empty line
See Implementation
Asserts that the given value is true, but unlike standard assert throws an exception on error.