C ++ 11标准是否提供boost :: any之类的东西? [英] Does C++11 standard provide something like boost::any?
问题描述
例如boost::function
几乎完全移到了std::function
,与boost::shared_ptr
一样.
for example boost::function
is moved almost entirely to std::function
, the same is with boost::shared_ptr
但是我找不到std::any
吗?
是重命名还是以任何理由将其放置在新标准中?
But I can't find std::any
?
Was it renamed or was not it placed in new standard at all by any reason?
推荐答案
并不是boost中的每个库都使其成为标准库(甚至包括那些已删除组件的库).通常,在添加到标准库中时,提交人相当保守(因为如果包含错误(例如,因为有更好的选择),在以后无法删除某些内容几乎是不可能的).
Not every library from boost makes it into the standard (and even those that do may have components removed). Generally the commitee is pretty conservative when it comes to adding to the standardlibrary (since it's next to impossible to get something removed at a later point if the inclusion was a mistake (.e.g. because there is a better alternative)).
boost::function
和boost::shared_ptr
几乎可以包含在内,因为它们已经是tr1
的一部分.另一方面,boost::any
没有切入.但是,稍后可能会将其包含在标准库中(例如,在下一次技术报告中,请参阅
boost::function
and boost::shared_ptr
where pretty much a given for inclusion since they where already part of tr1
. boost::any
on the other hand did not make the cut. It might however be included in the standard library at a later point (e.g. in the next technical report, look here). While boost::any
is nice to have, I wouldn't rate it as quite as important as e.g. shared_ptr
.
结论: boost::any
不属于C ++ 11,因为委员会认为没有任何迫切需要将其包括在内
Concluding: boost::any
is not part of C++11, since the committee didn't see any pressing need to include it
这篇关于C ++ 11标准是否提供boost :: any之类的东西?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!