Type-safe covariance in C++

  • Authors:
  • Vitaly Surazhsky;Joseph (Yossi) Gil

  • Affiliations:
  • Israel-Institute of Technology, Technion City, Haifa, Israel;Israel-Institute of Technology, Technion City, Haifa, Israel

  • Venue:
  • Proceedings of the 2004 ACM symposium on Applied computing
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

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.