0
Q:

assert

assert(std::is_same_v<int, int>); // error: assert does not take two arguments
assert((std::is_same_v<int, int>)); // OK: one argument
static_assert(std::is_same_v<int, int>); // OK: not a macro
std::complex<double> c;
assert(c == std::complex<double>{0, 0}); // error
assert((c == std::complex<double>{0, 0})); // OK
1
In simple words, if the assert condition is true then the
program control will execute the next test step but if the condition is
false, the execution will stop and further test step will not be executed.
0

New to Communities?

Join the community