[assertions] (original) (raw)

19 Diagnostics library [diagnostics]


19.3.1 General [assertions.general]

19.3.2 Header synopsis [cassert.syn]

19.3.3 The assert macro [assertions.assert]


19.3.1 General [assertions.general]

The header provides a macro for documenting C++ program assertions and a mechanism for disabling the assertion checks through defining the macro NDEBUG.

19.3.2 Header synopsis [cassert.syn]

#define assert(...) see below

19.3.3 The assert macro [assertions.assert]

If NDEBUG is defined as a macro name at the point in the source file where <cassert> is included, the assert macro is defined as#define assert(...) ((void)0)

Otherwise, the assert macro puts a diagnostic test into programs; it expands to an expression of type void which has the following effects:

The macro assert is redefined according to the current state of NDEBUG each time that<cassert> is included.