一旦成为标准的一部分 - boost 库会失去它的 boost 命名空间并被移动到 std 吗?

发布于 2024-10-03 10:55:10 字数 139 浏览 1 评论 0原文

一旦 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乱了心跳 2024-10-10 10:55:10

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::bindboost::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 of bind, people compiling C++0x will use std::bind while people compiling C++03 will keep using boost::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 from std::bind at some point (hell, I haven't read the C++0x standard yet so I don't have the answer, but std::bind might already be different from boost::bind !).

There is no issue with namespace clash here : each library stands in it own namespace, and you could very well use std::bind and boost::bind in the same C++0x project.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文