Appendix A. DANGER: Programming with Templates

Table of Contents
A.1. Templates Execute at Compile-Time
A.2. Template Programming for POOMA Users
A.3. Template Programming Used to Write POOMA

POOMA extensively uses C++ templates to support type polymorphism without incurring any run-time cost. In this chapter, we briefly introduce using templates in C++ programs by relating them to "ordinary" C++ constructs such as values, objects, and classes. The two main concepts underlying C++ templates will occur repeatedly:

For those interested in the implementation of POOMA, we close the section with a discussion of some template programming concepts used in the implementation but not likely to be used by POOMA users.