Skip to main content

An Extension to the Subtype Relationship in C++ Implemented with Template Metaprogramming

  • Conference paper
Generative Programming and Component Engineering (GPCE 2003)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2830))

Abstract

Families of independent classes, where each class represents a separate, orthogonal concern are highly attractive for implementing collaboration-based design. However, required subtype relationship between such families cannot be expressed in many programming languages. This paper presents a framework to handle collaborating groups of classes using template metaprogramming based on standard C++ features in the style of Loki::Typelist. Our solution provides tailor-made implicit conversion rules between appropriate groups, inclusion polymorphism and a tool for dynamic binding.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Alexandrescu, A.: Modern C++ Design: Generic Programming and Design Patterns Applied. Addison-Wesley, Reading (2001)

    Google Scholar 

  2. Bergmans, L., Aksit, M.: Composing Crosscutting Concerns Using Composition Filters. Communications of the ACM 44(10), 51–57 (2001)

    Article  Google Scholar 

  3. Bruce, K.B.: Foundations of Object-Oriented Languages. The MIT Press, Cambridge (2002)

    Google Scholar 

  4. Cardelli, L.: Structural Subtyping and the Notion of Power Type. In: Conference Record of the 15th Annual ACM Symposium on Principles of Programming Languages, San Diego, California, January 1988, pp. 70–79 (1988)

    Google Scholar 

  5. Eclipse. The aspectj project, http://www.eclipse.org/aspectj/

  6. Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools and Applications. Addison-Wesley, Reading (2000)

    Google Scholar 

  7. Eisenecker, U.W., Blinn, F., Czarnecki, K.: A Solution to the Constructor-Problem of Mixin-Based Programming in C++. Presented at the GCSE2000 Workshop on C++ Template Programming

    Google Scholar 

  8. Kiczales, G., Lamping, J., Mendhekar, A., Maeda, C., Lopes, C.V., Loingtier, J.-M., Irwin, J.: Aspect-Oriented Programming. In: Aksit, M., Matsuoka, S. (eds.) ECOOP 1997. LNCS, vol. 1241, pp. 220–242. Springer, Heidelberg (1997)

    Chapter  Google Scholar 

  9. Meyers, S.: Effective STL, pp. 33–35. Addison-Wesley, Reading (2001)

    Google Scholar 

  10. Patrick, A., Muckelbauer, V.F.: Russo. Lingua Franca: An IDL for Structural Subtyping Distributed Object Systems. USENIX Conference on Object-Oriented Technologies (COOTS), http://www.usenix.org/publications/library/proceedings/coots95/

  11. Ossher, H., Tarr, P.: Multi-Dimensional Separation of Concerns and The Hyperspace Approach. IBM Research Report 21452, IBM T.J. Watson Research Center (April 1999), http://www.research.ibm.com/hyperspace/Papers/tr21452.ps

  12. Smaragdakis, Y., Batory, D.: Mixin-Based Programming in C++. In: Proceedings of Net Object Days, pp. 464–478 (2000)

    Google Scholar 

  13. Spinczyk, O., Gal, A., Schröder-Preikschat, W.: AspectC++: An Aspect-Oriented Extension to C++. In: Proceedings of the 40th International Conference on Technology of Object-Oriented Languages and Systems (TOOLS Pacific 2002), Sydney, Australia, February 18-21 (2002), http://www.aspectc.org/download/tools2002.ps.gz

  14. Stroustrup, B.: The C++ Programming Language Special Edition. Addison-Wesley, Reading (2000)

    Google Scholar 

  15. Ossher, H., Tarr, P.: Multi-Dimensional Separation of Concerns and The Hyperspace Approach. IBM Research Report 21452, IBM T.J. Watson Research Center (April 1999), http://www.research.ibm.com/hyperspace/Papers/tr21452.ps

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Zólyomi, I., Porkoláb, Z., Kozsik, T. (2003). An Extension to the Subtype Relationship in C++ Implemented with Template Metaprogramming. In: Pfenning, F., Smaragdakis, Y. (eds) Generative Programming and Component Engineering. GPCE 2003. Lecture Notes in Computer Science, vol 2830. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-39815-8_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-39815-8_13

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-20102-1

  • Online ISBN: 978-3-540-39815-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics