How Templates Enable High-Performance Scientific Computing in C++

  • Authors:
  • Scott Haney;James Crotinger

  • Affiliations:
  • -;-

  • Venue:
  • Computing in Science and Engineering
  • Year:
  • 1999

Quantified Score

Hi-index 0.01

Visualization

Abstract

The C++ programming language has a powerful template facility that enables the development of flexible software without incurring a large abstraction penalty. Templates let programmers tell the compiler how to create classes and functions parametrized in terms of other types and constants. Programmers often use templates to implement type-safe generic containers that hold elements of a particular type, or generic functions that can, for example, sort the elements in an arbitrary generic container. Templates are one of the most complex C++ language features. For this reason, they were deliberately left out of the Java programming language. Nevertheless, templates are the fundamental enabling technology that supports construction of maintainable, highly abstract, high-performance scientific codes in C++.