|
Boost : |
From: Philippe Mori (philippe_mori_at_[hidden])
Date: 2005-01-07 20:25:13
Well, my last reply does not seem to get through...
----- Original Message -----
From: "Doug Gregor" <dgregor_at_[hidden]>
Newsgroups: gmane.comp.lib.boost.devel
Sent: Friday, January 07, 2005 10:42 AM
Subject: Re: Re: BOOST_NO_RTTI?
>
> On Jan 7, 2005, at 10:01 AM, David Abrahams wrote:
>> Douglas Gregor wrote:
>>> We've now had a user request that could be solved by adding a
>>> BOOST_NO_RTTI macro, that (when set) would disable Boost's use of
>>> constructs that use run-time type information (dynamic_cast, typeid,
>>> etc.), similar to our BOOST_NO_EXCEPTIONS.
>>>
>>> http://lists.boost.org/MailArchives/boost-users/msg09240.php
>>>
>>> I'll plan to add it unless there is violent disagreement.
>>
>> I thought BOOST_NO_XXX macros, where XXX is as standard C++ feature,
>> were supposed to be _detection_ macros (?)
>
> Okay, so let's have BOOST_NO_RTTI defined when the compiler/environment
> does not support RTTI, and we can use it to turn off use of RTTI in some
> Boost components :)
>
Well, I think that we should first ensure we never uses RTTI if we don't
need it so if it is possible to determine it at compile-time, we should
then uses specialization for each case (RTTI needed and RTTI not needed).
In that case if we try to uses the specialization that require RTTI and RTTI
is
not enabled, we should force a compile-time assertion.
If RTTI is uses for some optimizations but is not strictly necessary, then
we should not used it if it is not available (as we can determine from
compiler specific defines).
Finally, my compiler only giving me a warning (CodeWarrior when using
boost::function with RTTI disabled). It might be good to add a comment
in the code and a note in the documentation that explain why RTTI is
used and the effect of turning it off. Also, the program seems to run
correctly when I try it.
Philippe
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk