ABSTRACT
We present a programming technique for implementing type safe covariance in C++. In a sense, we implement most of Bruce's matching approach to the covariance dilemma in C++. The appeal in our approach is that it relies on existing mechanisms, specifically templates, and does not require any modification to the existing language. The practical value of the technique was demonstrated in its successful incorporation in a large software body. We identify the ingredients of a programming language required for applying the technique, and discuss extensions to other languages.
- K. Arnold and J. Gasling. The Java Prog. Lang. Addison-Wesley, 1996.]]Google Scholar
- K. Bruce. Increasing JAVA'S expressiveness with this Type and match-bounded polymorphism. On the web6, 1997.]]Google Scholar
- K. Bruce, L. Cardeli, G. Castagna, T. H. O. Group, G. T. Leavens, and B. Pierce. On binary methods. Theory and Practice of Object Systems, 1(3), 1996.]]Google Scholar
- K. B. Bruce, A. Fiech, and L. Petersen. Subtyping is not a good "match" for oo lang. In ECOOP'97.]]Google Scholar
- K. B. Bruce, A. Fiech, A. Schuett, and R. van Gent. PolyTOIL: A type-safe polymorphic oo lang. In ECOOP'95, pp. 27--51.]] Google ScholarDigital Library
- L. Cardelli and P. Wegner. On understanding types, data abstractions, and polymorphism. ACM Comput. Surv., 17(4):471--522, Dec. 1985.]] Google ScholarDigital Library
- G. Castagna. Covariance and contravariance: conflict without a cause. ACM Trans. Prog. Lang. Syst., 17(3):431--447, 1995.]] Google ScholarDigital Library
- C. Chambers and G. T. Leavens. Typechecking and modules for multi-methods. ACM Trans. on Prog. Lang. Syst., 17(6):805--843, 1995.]] Google ScholarDigital Library
- D. Colnet and L. Liquori. Match-O, a dialect of Eiffel with Match-Types, pp. 190--201. In TOOLS PACIFIC'00.]]Google Scholar
- E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable OO Soft. Addison-Wesley, 1995.]] Google ScholarDigital Library
- J. Y. Gil and Z. Gutterman. Compile time symbolic derivation with C++ templates. In COOTS'98, pp. 249--262.]] Google ScholarDigital Library
- A. Goldberg and D. Robson, Smalltalk-80: The Language and its Implementation. Addison-Wesley, 1983.]] Google ScholarDigital Library
- C. Gotsman and V. Surazhsky. Guaranteed intersection-free polygon morphing. Computers & Graphics, 25(1):67--75, Feb. 2001.]]Google ScholarCross Ref
- O. L. Madsen, B. Møller-Pedersen, and K. Nygaard. OO Prog. in the Beta Prog. Lang. Addison-Wesley, 1993.]]Google Scholar
- B. Meyer. EIFFEL: The Language. Prentice-Hall, 1992.]] Google ScholarDigital Library
- T. Millstein and C. Chambers. Modular statically typed multimethods. In ECOOP'99, pp. 279--303.]] Google ScholarDigital Library
- D. R. Musser and A. Saini. STL Tutorial and Reference Guide. C++ Prog. with the Standard Template Library. Addison-Wesley, 1996.]] Google ScholarDigital Library
- S. M. Omohundro The Sather 1.0 Specification, Jan. 1994.]]Google Scholar
- L. C. Paulson. ML for the Working Programmer. Cambridge University Press, Cambridge, 1991.]] Google ScholarDigital Library
- R. Rinat. Type-safe covariant specialization with generalized matching. In The 7th Int. Workshop on Foundations of OO Lang.]]Google Scholar
- G. Steele. Common Lisp-the Lang. Digital, 1990.]] Google ScholarDigital Library
- B. Stroustrup. The C++ Prog. Lang. Addison-Wesley. 2nd ed., 1991.]]Google Scholar
- B. Stroustrup. The C++ Prog. Addison-Wesley, 3rd ed., 1997.]]Google Scholar
- V. Surazhsky and C. Gotsman. Controllable morphing of compatible planar triangulations. ACM Trans. on Graphics, 20(4):203--231, 2001.]] Google ScholarDigital Library
- V. Surazhsky and C. Gotsman. Explicit surface remeshing. In Proc. of Eurographics/ACM Siggraph Symp. on Geom. Processing, pp. 17--28.]] Google ScholarDigital Library
- C. Szypersky, S. Omohundro, and S. Murer. Engineering a prog. lang.: The type and class system of Sather. Tech. Rep. 93--064, The Int. Comp. Sc. Inst., Berkeley, Ca, Nov. 1993.]]Google Scholar
- D. A. Watt. Prog. Lang.: Concepts and Paradigms. Prentice-Hall, 1990.]] Google ScholarDigital Library
- N. Wirth. The prog. lang. Pascal. Acta Inf., 1:35--63, 1971.]]Google ScholarDigital Library
Index Terms
- Type-safe covariance in C++
Recommendations
Ironclad C++: a library-augmented type-safe subset of c++
OOPSLA '13The C++ programming language remains widely used, despite inheriting many unsafe features from C---features that often lead to failures of type or memory safety that manifest as buffer overflows, use-after-free vulnerabilities, or abstraction ...
Ironclad C++: a library-augmented type-safe subset of c++
OOPSLA '13: Proceedings of the 2013 ACM SIGPLAN international conference on Object oriented programming systems languages & applicationsThe C++ programming language remains widely used, despite inheriting many unsafe features from C---features that often lead to failures of type or memory safety that manifest as buffer overflows, use-after-free vulnerabilities, or abstraction ...
An operational semantics and type safety prooffor multiple inheritance in C++
OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-oriented programming systems, languages, and applicationsWe present an operational semantics and type safety proof for multiple inheritance in C++. The semantics models the behaviour of method calls, field accesses, and two forms of casts in C++ class hierarchies exactly, and the type safety proof was ...
Comments