C++ Language/ErrorHandling/Assertions

The assert(condition); statement is conditionally-compiled. When building a debug build-configuration, define the _DEBUG preprocessor symbol so that assert() will evaluate its condition (aborting the software execution if that condition evaluates to false). When building a release build-configuration, instead define the NDEBUG preprocessor symbol so that assert() efficiently generates no machine language code.

Additional information about assertions