by 20k · 1mo ago · 0 comments
To my mind the extent of the contract is that if the user has set NDEBUG then you can assume that assert will be a noop. I don't think you as a library author can make any assumptions about what happens if you set the flag yourself.
There's no difference between the flag being set/unset by your build system, and #define-ing or #undef-ing the symbol in code