|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-08-20 12:46:38
Robert Ramey:
> What is an "implicit requirement"? You mean that previous users
> of boost/throw_exception where remiss if they didn't derive
> from std::exception
Yes, they were. This was often caused by silent bugs - throwing enums
instead of the appropriate exception type, in one case.
> or if they didn't surround throw_exception
> with #if BOOST_NO_TYPEID.
No, throw_exception is not supposed to be surrounded by #if BOOST_NO_TYPEID,
and it would in any case be incorrect to do so.
What it _is_ supposed to do is work and not cause problems for people
unaware of Boost.Exception, and it will hopefully be fixed accordingly.
For this to happen, Boost.Config needs to acquire a BOOST_NO_RTTI macro.
Incidentally, g++ 4.3 now seems to have a predefined __GXX_RTTI macro that
we can use to autodetect that BOOST_NO_TYPEID and BOOST_NO_RTTI need to be
set (earlier g++ versions did not).
> Hmmm - It looks to me that the previous code would work fine
> on a no-exeptions platform - all it did was call a user defined
> throw_exception function.
No, it would fail to compile. The user-defined function took an
std::exception argument.
A fundamental issue is that there are many configurations relevant to our
users that we don't test. -Wshadow -Wundef is one, no-exceptions is another,
no-RTTI is a third one. Speaking as a lib maintainer, I try to keep the
libraries working under these conditions, but without test results, it's not
easy to do so.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk