Skip to content

Opening book details…

Can I read Double dispatch in C++ on EtoBox?

Double dispatch in C++ by Lorenzo Bettini; Sara Capecchi; Betti Venneri is a Computer Science article available to read on EtoBox.

What is Double dispatch in C++ about?

Double dispatch is the ability to dynamically select a method not only according to the run-time type of the receiver (single dispatch), but also according to the run-time type of the argument. This mechanism unleashes the power of dynamic binding in object-oriented languages, so enhancing re-usability and separation of responsibilities. However, many mainstream languages, such as, e.g., C++ and Java, do not provide it, resorting only to single dispatch. In this paper we propose an extension of C++ (also applicable to other object-oriented languages) that enables double dispatch as a language feature. This yields dynamic overloading and covariant specialization of methods. We define a translation from the new constructs to standard C++ and we present the preprocessor implementing this translation, called doublecpp. The translated code enjoys static type safety and implements the semantics of double dispatch by using only standard mechanisms of static overloading and dynamic binding, with minimal impact on the performance of the program.

Who reads Double dispatch in C++?

It is typically read by researchers, students, and practitioners in Computer Science.

Author
Lorenzo Bettini; Sara Capecchi; Betti Venneri
Publisher
John Wiley and Sons; Wiley (John Wiley & Sons); John Wiley & Sons Inc.; Wiley (ISSN 0038-0644)
Published
2006
Language
EN
Field
Computer Science (Physical Sciences)

More by Lorenzo Bettini; Sara Capecchi; Betti Venneri

Browse all works by Lorenzo Bettini; Sara Capecchi; Betti Venneri