c++performanceboostrttiboost-any

Does boost::any need RTTI?


On the Boost web site I found no information regarding the use or RTTI by boost::any.

I read in a few places that this is a requirement, but then I built a simple test project, and it builds both with and without RTTI.

So, is RTTI, with its performance and memory issues, needed by boost::any and similar classes?


Solution

  • Since boost 1.57 RTTI is not needed for boost::any. Rememeber that all objects used as boost::any must by copyable.

    https://svn.boost.org/trac/boost/ticket/10346