Boost logo

Boost :

From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2007-06-30 05:10:37


Eric Friedman wrote:
> This is used by variant to support the variant::type method.
> Otherwise, as Benoit explained, it is not used.

> I know in the past there had been discussion about defining a
> BOOST_NO_RTTI macro, but I don't think this went anywhere...? If there
> were such a macro, the variant implementation could be changed to
> conditionally compile the variant::type method, etc.

Wouldn't it be cleaner to just deprecate that member function and
reintroduce a freestanding version in a separate header (so the
dependencies are as optional as the feature)?

This takes some time, however, a fake 'typeinfo' header might serve as a
short-term workaround to make code like variant compile as-is without RTTI:

     // unrefined and untested code for illustration only

     namespace std
     {
         struct RTTI_NOT_SUPPORTED;
         typedef RTTI_NOT_SUPPORTED type_info;
     }

     #define typeid *( ::std::type_info* )sizeof

Regards,
Tobias


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk