一旦成为标准的一部分 - boost 库会失去它的 boost 命名空间并被移动到 std 吗?
一旦 Boost 库(我读到十个 Boost 库被认为是标准库的一部分)成为标准库的一部分 - 它会保留它的 boost 命名空间还是代码最终会出现在 std 命名空间中?
如果是后者,您将如何解决代码中潜在的命名空间冲突。
干杯。
Once a Boost library (I have read that ten Boost libs are considered to be a become a part of Standard Library) becomes a part of Standard Library - is it going to keep it's boost namespace or the code will end up in std namespace?
If the latter is the case - how would you workaround that potential namespace clash in your code.
Cheers.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Boost 库中符合标准的项目当然会包含在命名空间
std
中。然而,我不认为他们的 Boost 对应物会发生任何改变:如果我们以bind
为例,编译 C++0x 的人将使用std::bind
> 而编译 C++03 的人们将继续使用boost::bind
。我可能是错的,但根据我的理解,是 boost 库的概念使其成为标准,而不是确切的规范。据我所知,boost::bind 很可能会不断发展,并在某个时候提供与 std::bind 不同的东西(天啊,我还没读过C++0x 标准尚未实现,所以我没有答案,但
std::bind
可能已经与boost::bind
不同!)。这里不存在命名空间冲突的问题:每个库都位于自己的命名空间中,并且您可以很好地在同一个 C 中使用
std::bind
和boost::bind
++0x 项目。The items from Boost libraries that made it to the standard will of course be included in namespace
std
. However, I don't think that their Boost counterpart will change in any way : if we take the example ofbind
, people compiling C++0x will usestd::bind
while people compiling C++03 will keep usingboost::bind
.I may be wrong, but from my understanding, it's the concepts from boost libraries that made it to the standard, not the exact specifications. As far as I know,
boost::bind
could very well keep evolving and provide something different fromstd::bind
at some point (hell, I haven't read the C++0x standard yet so I don't have the answer, butstd::bind
might already be different fromboost::bind
!).There is no issue with namespace clash here : each library stands in it own namespace, and you could very well use
std::bind
andboost::bind
in the same C++0x project.