This macro is disabled if, at the moment of including <cassert>, a macro with the name NDEBUG has already been defined. This allows for a coder to include as many assert calls as needed in a source code while debugging the program and then disable all of them for the production version by simply including a line like:
at the beginning of the code, before the inclusion of <cassert>.
Therefore, this macro is designed to capture programming errors, not user or run-time errors, since it is generally disabled after a program exits its debugging phase.
Are you wanting run-time assertion testing, or maybe compile-time testing?
No header needed, C++11's static_assert() might fit the bill if the latter:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// this example will not compile!
template <typename T>
static_assert(sizeof(T) != sizeof(int), "No int please!");