boost :: any是否需要RTTI? [英] Does boost::any need RTTI?
本文介绍了boost :: any是否需要RTTI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Boost网站上,我没有找到关于boost :: any的使用或RTTI的信息.
On the Boost web site I found no information regarding the use or RTTI by boost::any.
我在几个地方读到这是一个要求,但是后来我建立了一个简单的测试项目,它在有和没有RTTI的情况下都可以构建.
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.
那么,boost :: any和类似的类是否需要RTTI及其性能和内存问题?
So, is RTTI, with its performance and memory issues, needed by boost::any and similar classes?
推荐答案
由于boost::any
不需要boost 1.57 RTTI.请记住,所有用作boost::any
的对象都必须是可复制的.
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
这篇关于boost :: any是否需要RTTI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文