Support for the Evolution of C++ Generic Functions

  • Peter Pirkelbauer
  • Damian Dechev
  • Bjarne Stroustrup
Conference paper

DOI: 10.1007/978-3-642-19440-5_8

Part of the Lecture Notes in Computer Science book series (LNCS, volume 6563)
Cite this paper as:
Pirkelbauer P., Dechev D., Stroustrup B. (2011) Support for the Evolution of C++ Generic Functions. In: Malloy B., Staab S., van den Brand M. (eds) Software Language Engineering. SLE 2010. Lecture Notes in Computer Science, vol 6563. Springer, Berlin, Heidelberg

Abstract

The choice of requirements for an argument of a generic type or algorithm is a central design issue in generic programming. In the context of C++, a specification of requirements for a template argument or a set of template arguments is called a concept.

In this paper, we present a novel tool, TACE (template analysis and concept extraction), designed to help programmers understand the requirements that their code de facto imposes on arguments and help simplify and generalize those through comparisons with libraries of well-defined and precisely-specified concepts. TACE automatically extracts requirements from the body of function templates. These requirements are expressed using the notation and semantics developed by the ISO C++ standards committee. TACE converts implied requirements into concept definitions and compares them against concepts from a repository. Components of a well-defined library exhibit commonalities that allow us to detect problems by comparing requirements from many components: Design and implementation problems manifest themselves as minor variations in requirements. TACE points to source code that cannot be constrained by concepts and to code where small modifications would allow the use of less constraining concepts. For people who use a version of C++ with concept support, TACE can serve as a core engine for automated source code rejuvenation.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Peter Pirkelbauer
    • 1
  • Damian Dechev
    • 2
  • Bjarne Stroustrup
    • 3
  1. 1.Lawrence Livermore National LaboratoryCenter for Applied Scientific ComputingLivermoreUS
  2. 2.Department of Electrical Engineering and Computer ScienceUniversity of Central FloridaOrlandoUS
  3. 3.Department of Computer Science and EngineeringTexas A&M UniversityCollege StationUS

Personalised recommendations