为什么我应该使用 Apache C++标准库而不是任何其他 STL 实现以及 Boost?

发布于 2024-08-08 11:24:16 字数 124 浏览 2 评论 0原文

我从 Apache C++ 标准库 中获得了哪些我无法从编译器附带的 STL 实现中获得的好处以及来自 Boost 库?

What benefits do I get from Apache C++ standard library that I don't get from STL implementations that come with the compiler and from Boost libraries?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(5

漆黑的白昼 2024-08-15 11:24:16

Apache C++ 标准库
项目是一个完整的实施
ISO/IEC 14882 C++ 标准的
图书馆。

最显着的特征
C++ 的这个实现
标准库的可移植性是
大量的C++编译器,
操作系统和硬件
架构。

听起来如果您重视极致的便携性,那么这款产品就适合您。如果您不这样做,大多数人都会默认使用其编译器的默认实现,因此如果您遇到麻烦,社区将会更大。如果您没有遇到实施问题,我不明白为什么它会产生很大的影响。

我通常会因为这种观点而受到批评,但我喜欢有一家我可以付费来解决问题的公司的想法,我的开发人员(和我)不够聪明(或没有时间)深入研究内部结构并修复错误。

The Apache C++ Standard Library
project is a complete implementation
of the ISO/IEC 14882 C++ Standard
Library.

The most distinguishing characteristic
of this implementation of the C++
Standard Library is its portability to
a large number of C++ compilers,
operating systems, and hardware
architectures.

Sounds like if you value extreme portability this is for you. If you don't, most everyone defaults to their compiler's default implementation, so if you ever have trouble, the community will be bigger. If you don't run into implementation issues I don't see why it should make much of a difference.

I typically get flamed for this opinion but I like the idea of having a company I can pay to fix problems, my developers (and I) aren't smart enough (or don't have the time) to dive into internals and fix bugs.

亽野灬性zι浪 2024-08-15 11:24:16

stdxx 声称的优点之一对我来说似乎是正确的:

  • 针对快速编译进行了优化
    可执行文件大小极小

在本文中,Stroustrup 讨论了一些 C++ 编译器中应用的新想法,称为 可怕。我第一次在他的一篇论文中读到它。无论如何,此功能可以将生成的可执行文件大小大幅减少(~1x - ~25x),并且速度加快(~1.2x - ~2.1x)。在第一篇论文中,他说 Rogue Wave STL 支持 SCARY,至少在现代实现中是这样:

最新版本的 Rogue Wave
STL有独立的容器
迭代器处于生产模式,但是
一些标准容器'
迭代器在调试中不是独立的
模式。 N2911 解释说,这些
实际上并不需要依赖项
出于调试目的,可以轻松地
被删除。

因此,如果 stdxx 基于 Rogue Wave STL,它可能已经实现了这个想法。

One of the advantages that stdxx claims seems to be true to me:

  • Optimized for fast compiles and
    extremely small executable file sizes

In this paper, Stroustrup talks about a new idea applied in some C++ compilers called SCARY. I first read about it in one of his papers. Anyway, this feature allows reducing produced executables size by a great amount (~1x - ~25x), and faster by (~1.2x - ~2.1x). In the first paper, he said that Rogue Wave STL supports SCARY, at least in modern implementations:

The most recent version of Rogue Wave
STL has independent container
iterators in its production mode, but
some of the standard containers’
iterators are not independent in debug
mode. N2911 explains that these
dependencies are not actually required
for debugging purposes and can easily
be removed.

So, if stdxx is based on Rogue Wave STL, it might have this idea implemented already.

ま柒月 2024-08-15 11:24:16

不幸的是,自 2013 年 7 月起,该库不再受支持。请参阅邮件列表公告:http://mail-archives.apache.org/mod_mbox/stdcxx-dev/201307.mbox/browser

Unfortunately this library is no longer supported as of July 2013. See the mailing list announcement: http://mail-archives.apache.org/mod_mbox/stdcxx-dev/201307.mbox/browser

朮生 2024-08-15 11:24:16

Apache C++ 库最初是 Rogue Wave 的商业库。他们声称正在密切跟踪 C++ 标准,并努力确保跨各种操作系统和编译器的可移植性。 Rogue Wave 库声称已移植到 40 多个编译器。

Apache C++ library was originally a commercial library from Rogue Wave. They claim to be tracking the C++ standard very closely and working hard to insure portability across various operating systems and compilers. The Rogue Wave library claimed to have been ported to over 40 compilers.

铁轨上的流浪者 2024-08-15 11:24:16

我对 Apache C++ 标准库不熟悉,所以我不确定它有什么设施。如果您发现它提供了您需要的一切,那么使用它或与 Boost 一起使用另一个 STL 实现并没有太大区别。然而,Boost 提供的不仅仅是一些 TR1 功能和智能指针等小功能。它还具有:

  1. Lambdas/Closures
  2. 模板和预处理器元编程
  3. 信号和槽/观察者/监听器模式实现
  4. 参考包装器
  5. 许多其他随机的东西你不可能在单个库的其他地方找到

这一切都取决于你需要的设施。

I am not familiar with the Apache C++ Standard Library, so I'm not sure what facilities it has. If you find that it provides everything that you need, then there is not much of a difference using that or using another STL implementation alongside Boost. However, Boost provides a lot more than some TR1 features and little things like smart pointers. It also has:

  1. Lambdas/Closures
  2. Template and preprocessor metaprogramming
  3. Signals and slots/Observer/Listener pattern implementation
  4. Reference wrappers
  5. A lot of other random things you're not likely to find elsewhere in a single library

It all depends on the facilities that you need.

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