3

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?

Pietro
  • 12,086
  • 26
  • 100
  • 193
  • I've just tried to build a simple program with boost_any, and an executable built with -fno-rtti was actually larger than one built without. I have no idea what it means. – n. m. could be an AI Jul 12 '16 at 10:49

1 Answers1

5

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

paweldac
  • 1,144
  • 6
  • 11
  • I must say that if compilers would not just disallow `typeid` with RTTI disabled and allowed its use in non-polymorfic context, it would work without need to reinvent the wheel. – Revolver_Ocelot Jul 12 '16 at 09:20
  • @paweldac: OK, that is the reason of the contradicting information I found. – Pietro Jul 12 '16 at 09:30