Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!

Idiom #123 Assert condition

Verify that predicate isConsistent returns true, otherwise report assertion violation.
Explain if the assertion is executed even in production environment or not.

#include <assert.h>
assert(isConsistent());

If NDEBUG is defined, the assert macro becomes void. Therefore, such expressions must not have side effects.

New implementation...
< >
programming-idioms.org