Check out the new USENIX Web site.

Template Base Delegation


Ted Law
IBM Software Solutions Toronto Laborat
ory 844 Don Mills Road
North York, Ontario M3C 1V7
Canada
tedlaw@vnet.ibm.com

Abstract

When a class derives from a template instantiation, the base class is called a template base class. Non-template base classes are more commonly used, but do not take into account the specific needs of the derived class. The base class can provide better service; it can be customized by becoming a template instantiation using the derived class and/or other classes as arguments. In this way, the template base class can tailor-make itself for the derived class, taking advantage of the knowledge of its type. For example, the template base class can type its methods appropriately for the derived class. Furthermore, inheriting publicly from a template base class makes it possible for the derived class to delegate part of its public type-specific interface to the base. This paper explores the advantages of template base delegation.


Download the full text of this paper in ASCII (21,492 bytes) and POSTSCRIPT (80,975 bytes) form.

To Become a USENIX Member, please see our Membership Information.