Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-02-04 22:54:39


Joerg Ruedenauer <nospam_at_[hidden]> writes:

> Hello,
>
> we use our own assertion handler and assert macro in our code, defined
> in a header which gets included at the end of our precompiled header
> file. Unfortunately, many boost libraries undermine this because they
> include the cassert header, which redefines the assert macro.

That's a clue that you shouldn't be #defining assert.

> Currently we work around this by putting some boost libraries in the
> precompiled header and including our own assert header again in each
> source file which includes boost headers, but this is a clumsy and
> error-prone solution. Boost already nominately provides a solution
> through BOOST_ENABLE_ASSERT_HANDLER, but it's just not used
> consequently throughout the libraries.
>
> Could the authors of the libraries (or the reviewers) please grep
> through the code and change the cassert (or assert.h) includes to
> boost/assert.hpp, and consequently, change assert(...) to
> BOOST_ASSERT(...)?

It's a very good idea, and I think we should do it.

That said, unless you stop #defining names that appear in legitimate
standard library headers, you're bound to continue to have this
problem, or others like it.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net