On 9/04/2019 11:13, Niall Douglas wrote:
Why do you bother with the #ifdef NDEBUG ?
It signifies "this is important for the final release binary" i.e. please ask one of the tech leadership if you break this.
It has no technical meaning. But it is *very* effective at worrying people.
Its technical meaning is that during development in debug builds (which presumably people should be using most of the time in order to verify runtime asserts and other things like debug iterators and debug heaps), all of these asserts are disabled, so people don't discover that they did something wrong at the time that they broke it, which makes it harder to discover what they broke. So it seems like an odd choice, unless something about a debug build makes the assertion untrue (eg. debug components changing sizeof). Why not use #ifndef JUNIOR_DEVS_DONT_TOUCH or something similarly never defined (and so never disabling the check) but expressing your real intent?