John Black wrote:
assert(dump() == 0);
I wished using this way to avoid that dump() is called in optimized
mode compile, but it seems it does not work! I still see the dump out in
optimized version.
Any idea?
assert() becomes nothing when NDEBUG is turned on. Look that up. It's a
system different from your compiler's optimization settings. Many
environments put all these details together into modes, such as Debug Mode
and Release Mode. But they are all different systems.
BTW if you put a whole bunch of assertions inside your dump(), and rename it
test(), then you'd have an in-vivo test suite. Running these over and over
again, and putting all conceivable requirements inside them, is a great way
to keep bugs out, and prevent the need to Debug.
--
Phlip
http://industrialxp.org/community/bi...UserInterfaces