Generic design patterns in C++

Abstract

Generic programming is a paradigm whose wide adoption by the C++ community is quite recent. In this approach most classes and procedures are parameterized, leading to the construction of general and efficient software components. In this paper, we show how some design patterns from Gamma et al. can be adapted to this paradigm. Although these patterns rely highly on dynamic binding. We show that, by making intensive use of parametric polymorphism in the context of generic programming, the method calls in these patterns can be resolved at compile-time. The speed-up achieved using these patterns is significant.