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.
- Lennart Augustsson. Implementing Haskell Over-loading. In Functional Programming Languages and Computer Architecture, pages 65--73, 1993. Google Scholar
Digital Library
- Matthew H. Austern. Generic Programming and the STL. Addison-Wesley, October 1998.Google Scholar
Digital Library
- Manuel M. T. Chakravarty, Gabriele Keller, and Simon Peyton Jones. Associated Type Synonyms. In ACM SIGPLAN International Conference on Functional Programming, Tallinn, Estonia, 2005. ACM Press. Google Scholar
Digital Library
- Manuel M. T. Chakravarty, Gabriele Keller, Simon Peyton Jones, and Simon Marlow. Associated Types with Class. ACM SIGPLAN Notices, 40(1):1--13, January 2005. Google Scholar
Digital Library
- Gabriel Dos Reis. Generic Programming in C++: The next level. The Association of C and C++ Users Spring Conference, April 2002.Google Scholar
- Gabriel Dos Reis and Bjarne Stroustrup. A Formalism for C++. Technical Report N1885=05-0145, ISO/IECSC22/JTC1/WG21, October 2005.Google Scholar
- Gabriel Dos Reis and Bjarne Stroustrup. Specifying C++ Concepts. Technical Report N1886=05-0146, ISO/IEC SC22/JTC1/WG21, October 2005.Google Scholar
- Jean-Yves Girard. Interprétation fonctionnelle et élimination des coupures de l'arithmétique d'ordre supérieur. Thèse d'État, Université Paris VII, 1972.Google Scholar
- Ronald Garcia, Jaakko Järvi, Andrew Lumsdaine, Jeremy Siek, and Jeremiah Willcock. A Comparative Study of Language Support for Generic Programming. In Proceedings of the 18th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications, pages 115--134. ACM Press, 2003. Google Scholar
Digital Library
- Douglas Gregor, Jeremy Siek, Jeremiah Willcock, Jaakko Järvi, Ronald Garcia, and Andrew Lumsdaine. Concept for C++0x (Revision 1). Technical Report N1849=05-00109, ISO/IEC SC22/JTC1/WG21, August 2005.Google Scholar
- Cordelia V. Hall, Kevin Hammond, Simon Peyton Jones, and Philip L. Wadler. Type classes in Haskell. ACM Transactions on Programming Languages and Systems, 18(2):109--138, 1996. Google Scholar
Digital Library
- International Organization for Standards. International Standard ISO/IEC 14882. Programming Languages - C++, 2nd edition, 2003.Google Scholar
- Mark P. Jones. Qualified Types: Theory and Practice. Cambridge University Press, 1994. Google Scholar
Digital Library
- Richard D. Jenks and Robert S. Sutor. AXIOM: The Scientific Computation System. Springer-Verlag, 1992. Google Scholar
Digital Library
- Stefan Kaes. Parametric Overloading in Polymorphic Programming Languages. In Proceedings of the 2nd European Symposium on Programming, volume 300 of Lecture Notes In Computer Science;, pages 131--144. Springer-Verlag, 1988. Google Scholar
Digital Library
- Simon Peyton Jones. Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, 2003.Google Scholar
- Benjamin C. Pierce and David N. Turner. Local Type Inference. In Symposium on Principles of Programming Languages, pages 252--265, San Diego CA, USA, 1998. ACM. Google Scholar
Digital Library
- John Reynolds. Towards a theory of type structure. In Proceedings of Colloque sur la Programmation, volume 19 of Lecture Notes in Computer Science, pages 408--425, New York, 1974. Springer-Verlag. Google Scholar
Digital Library
- Bjarne Stroustrup and Gabriel Dos Reis. Concepts - Design choices for template argument checking. Technical Report N1522, ISO/IEC SC22/JTC1/WG21, September 2003.Google Scholar
- Bjarne Stroustrup and Gabriel Dos Reis. Concepts - syntax and composition. Technical Report N1536, ISO/IEC SC22/JTC1/WG21, September 2003.Google Scholar
- Bjarne Stroustrup and Gabriel Dos Reis. A Concept Design (rev.1). Technical Report N1782=05-0042, ISO/IEC SC22/JTC1/WG21, April 2005.Google Scholar
- Bjarne Stroustrup and Gabriel Dos Reis. Supporting SELL for High-Performance Computing. In Proceedings of the 18th International Workshop on Languages and Compilers for Parallel Computing, October 2005. Google Scholar
Digital Library
- Jeremy Siek, Douglas Gregor, Ronald Garcia, Jeremiah Willcock, Jaakko Järvi, and Andrew Lumsdaine. Concept for C++0x. Technical Report N1758=05-0018, ISO/IEC SC22/JTC1/WG21, January 2005.Google Scholar
- Alexander Stepanov and Meng Lee. The Standard Template Library. Technical Report N0482=94-0095, ISO/IEC SC22/JTC1/WG21, May 1994.Google Scholar
- Bjarne Stroustrup. Technical FAQ: Why can't I define constraints for my template parameters? http://www.research.att.com/~bs/bs_faq2.html#constraints.Google Scholar
- Bjarne Stroustrup. Parameterized Types for C++. In Proceedings of USENIX C++ Conference, Denver, CO., October 1988.Google Scholar
- Bjarne Stroustrup. The Evolution of C++: 1985-1989. USENIX Computer Systems, 2(3), 1989.Google Scholar
- Bjarne Stroustrup. The Design and Evolution of C++. Addison-Wesley, 1994. Google Scholar
Digital Library
- Bjarne Stroustrup. The C++ Programming Language. Addison-Wesley, special edition, 2000. Google Scholar
Digital Library
- Bjarne Stroustrup. Concept checking - A more abstract complement to type checking. Technical Report N1510, ISO/IEC SC22/JTC1/WG21, September 2003.Google Scholar
- Bjarne Stroustrup. Abstraction and the C++ model. In Proceedings of ICESS'04, December 2004.Google Scholar
- Bjarne Stroustrup. The design of C++0x. C/C++ Users Journal, May 2005.Google Scholar
- S. Tucker Taft, Robert A. Duff, Randall L. Brukardt, and Erhard Ploederer, editors. Consolidated Ada Reference Manual, volume 2219 of Lecture Notes in Computer Science. Springer, 2000. Google Scholar
Digital Library
- Philip Wadler and Stephen Blott. How to make ad-hoc polymorphism less ad hoc. In Proceedings of the 16th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 60--76, Austin, Texas, USA, 1989. Google Scholar
Digital Library
Index Terms
Specifying C++ concepts
Recommendations
Specifying C++ concepts
Proceedings of the 2006 POPL ConferenceC++ 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 ...
Concepts: linguistic support for generic programming in C++
OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applicationsGeneric programming has emerged as an important technique for the development of highly reusable and efficient software libraries. In C++, generic programming is enabled by the flexibility of templates, the C++ type parametrization mechanism. However, ...
Concepts: linguistic support for generic programming in C++
Proceedings of the 2006 OOPSLA ConferenceGeneric programming has emerged as an important technique for the development of highly reusable and efficient software libraries. In C++, generic programming is enabled by the flexibility of templates, the C++ type parametrization mechanism. However, ...







Comments