Boost logo

Boost :

Subject: Re: [boost] Variant2 review
From: Gavin Lambert (boost_at_[hidden])
Date: 2019-04-09 01:08:48


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?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk