|
Boost Users : |
From: David Abrahams (dave_at_[hidden])
Date: 2006-02-05 08:33:49
David Abrahams <dave_at_[hidden]> writes:
> 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.
Although I guess we have to be pretty careful, since things like
polymorphic_downcast are documented as using the standard assert
macro. Technically speaking, it's a breaking change.
-- 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