Logo

Programming-Idioms

History of Idiom 123 > diff from v21 to v22

Edit summary for version 22 by programming-idioms.org:
[C++] Emphasize in comments

Version 21

2020-05-19, 14:39:44

Version 22

2020-05-21, 16:07:07

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.

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.

Variables
isConsistent
Variables
isConsistent
Imports
#include <cassert>
Imports
#include <cassert>
Code
assert(isConsistent());
Code
assert(isConsistent());
Comments bubble
If NDEBUG macro is defined, the assert macro becomes void. Therefore, such expressions must not have side effects.
Comments bubble
If NDEBUG macro is defined, the assert macro becomes void.
Doc URL
https://en.cppreference.com/w/cpp/error/assert
Doc URL
https://en.cppreference.com/w/cpp/error/assert