What is the purpose of assert(false) in an if?

Viewed 95
1 Answers

In C assert is a macro that does nothing if NDEBUG is defined. In this case I'd guess assert(false) is inside the conditional to ensure that even if abort() is not called (because assert() was a no-op due to NDEBUG or redefinition) the function returns.

Related