In Visual C++, assertions are disabled in Release mode and enabled in Debug mode of the solution. I find assertions to be cheap and effective means of capturing programmer errors and would like assertions to be invoked during Release mode too.
assert is a macro and its existence during compilation is controlled by the definition of the
NDEBUG identifier. If
NDEBUG is defined, assertions are disabled. As you can guess, by default,
NDEBUG is defined in Release mode.
So, to enable assertions in Release mode, go to the project properties → C/C++ → Preprocessor → Preprocessor Definitions and remove
Tried with: Visual C++ 2008