Specifying C++ concepts
Authors:
Open Access
- 11 January 2006
- journal article
- conference paper
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 41 (1) , 295-308
Abstract
C++ templates are key to the design of current successful mainstream libraries and systems. They are the basis of programming techniques in diverse areas ranging from conventional general-purpose programming to software for safety-critical embedded systems. Current work on improving templates focuses on the notion of concepts (a type system for templates), which promises significantly improved error diagnostics and increased expressive power such as concept-based overloading and function template partial specialization. This paper presents C++ templates with an emphasis on problems related to separate compilation. We consider the problem of how to express concepts in a precise way that is simple enough to be usable by ordinary programmers. In doing so, we expose a few weakness of the current specification of the C++ standard library and suggest a far more precise and complete specification. We also present a systematic way of translating our proposed concept definitions, based on use-patterns rather than function signatures, into constraint sets that can serve as convenient basis for concept checking in a compiler.Keywords
This publication has 13 references indexed in Scilit:
- Supporting SELL for High-Performance Computing2006
- Associated type synonyms2005
- Associated types with classACM SIGPLAN Notices, 2005
- A comparative study of language support for generic programming2003
- Consolidated Ada Reference Manual Language and Standard LibrariesLecture Notes in Computer Science, 2000
- Local type inference1998
- Type classes in HaskellACM Transactions on Programming Languages and Systems, 1996
- Qualified Types1994
- Implementing Haskell overloading1993
- Towards a theory of type structure1974