Signatures: A C++ Extension for Type Abstraction and Subtype Polymorphism (1994)
| Venue: | Software: Practice & Experience |
| Citations: | 10 - 0 self |
BibTeX
@TECHREPORT{Baumgartner94signatures:a,
author = {Gerald Baumgartner and Vincent F. Russo},
title = {Signatures: A C++ Extension for Type Abstraction and Subtype Polymorphism},
institution = {Software: Practice & Experience},
year = {1994}
}
OpenURL
Abstract
C++ uses inheritance as a substitute for subtype polymorphism. We give examples where this makes the type system too inflexible. We then describe a conservative language extension that allows us to define an abstract type hierarchy independent of any implementation hierarchies, to retroactively abstract over an implementation, and to decouple subtyping from inheritance. This extension gives the user more of the flexibility of dynamic typing while retaining the efficiency and security of static typing. With default implementations and views we provide flexible mechanisms for implementing an abstract type by different concrete class types. We first show how our language extension can be implemented in a preprocessor to a C++ compiler, and then detail and analyze the efficiency of an implementation we directly incorporated in the GNU C++ compiler.







