Perhaps I did not understand you correctly, but IMO assert () should not be used in release code to do what you describe, for example, to force invariants to be applied.
If the premises of the function are incorrect, what would you like to do? How do you want to report this:
- interactive user?
- your support staff
In both cases, you will need to call the error handling code, and (it seems to me) exceptions - this is just a ticket.
However, if you still want to go this route, you can put the following at the beginning of each source file:
#undef NDEBUG
I do NOT recommend this. Please do not do this. No one will thank you :-)
Seb
source share