首页> 外文会议>Software language engineering. >Design of Concept Libraries for C++ Andrew Sutton and Bjarne Stroustrup
【24h】

Design of Concept Libraries for C++ Andrew Sutton and Bjarne Stroustrup

机译:C ++ Andrew Sutton和Bjarne Stroustrup的概念库设计

获取原文
获取原文并翻译 | 示例

摘要

We present a set of concepts (requirements on template arguments) for a large subset of the ISO C++ standard library. The goal of our work is twofold: to identify a minimal and useful set of concepts required to constrain the library's generic algorithms and data structures and to gain insights into how best to support such concepts within C++. We start with the design of concepts rather than the design of supporting language features; the language design must be made to fit the concepts, rather than the other way around. A direct result of the experiment is the realization that to simply and elegantly support generic programming we need two kinds of abstractions: constraints are predicates on static properties of a type, and concepts are abstract specifications of an algorithm's syntactic and semantic requirements. Constraints are necessary building blocks of concepts. Semantic properties are represented as axioms. We summarize our approach: concepts = constraints + axioms. This insight is leveraged to develop a library containing only 14 concepts that encompassing the functional, iterator, and algorithm components of the C++ Standard Library (the STL). The concepts are implemented as constraint classes and evaluated using Clang's and GCC's Standard Library test suites.
机译:我们为ISO C ++标准库的大部分子集提供了一组概念(对模板参数的要求)。我们工作的目标是双重的:确定约束图书馆的通用算法和数据结构所需的最小和有用的概念集,并获得有关如何在C ++中最好地支持这些概念的见解。我们从概念的设计开始,而不是支持语言功能的设计。语言设计必须适合概念,而不是相反。实验的直接结果是认识到,要简单而优雅地支持通用编程,我们需要两种抽象:约束是对类型的静态属性的谓词,概念是对算法的句法和语义要求的抽象规范。约束是概念的必要组成部分。语义特性表示为公理。我们总结一下我们的方法:概念=约束+公理。利用这种见识来开发仅包含14个概念的库,其中包含C ++标准库(STL)的功能,迭代器和算法组件。这些概念被实现为约束类,并使用Clang和GCC的标准库测试套件进行了评估。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号