Does boost::any need RTTI?

狂风中的少年 提交于 2019-12-11 05:53:22

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/38324511/does-boostany-need-rtti

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!