arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1111.3673cs.PL
收藏

C++标准模板库模板专用容器

C++ Standard Template Library by template specialized containers

N. Pataki

摘要:

C++标准模板库是基于泛型编程范式的库的旗舰示例。使用这个库的目的是最大限度地减少经典C/C++错误的数量,但并不保证程序没有错误。此外,许多新类型的错误可能来自于泛型编程范式的不准确使用,比如解引用无效的迭代器或误解类似于删除的算法。在本文中,我们提出了一些典型的情况下,可能会导致运行时或可移植性的问题。当使用这些有风险的构造时,我们发出警告和错误。我们还提出了一种通用的方法来发出“定制”的警告。我们支持所谓的“相信我标记”来禁用警告。我们提出了我们的技术的另一个典型用法,当类在软件生命周期中被弃用时。

英文摘要:

The C++ Standard Template Library is the flagship example for libraries based on the generic programming paradigm. The usage of this library is intended to minimize the number of classical C/C++ errors, but does not warrant bug-free programs. Furthermore, many new kinds of errors may arise from the inaccurate use of the generic programming paradigm, like dereferencing invalid iterators or misunderstanding remove-like algorithms. In this paper we present some typical scenarios that may cause runtime or portability problems. We emit warnings and errors while these risky constructs are used. We also present a general approach to emit "customized" warnings. We support the so-called "believe-me marks" to disable warnings. We present another typical usage of our technique, when classes become deprecated during the software lifecycle.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑