Double Dispatch in C++: Recover Original Type of the Object Pointed by Base Class Pointer

Double Dispatch in C++ is a mechanism that dispatches a function call to different concrete functions depending on the runtime types of two objects involved in the call. In more simple words, its function calling using two different virtual tables of respective two objects. I know this sounds cryptic, but don’t worry I will come to double dispatch solution after trying most of the naive solution so that you will come away with the full understanding of concept without having needless confusions....

April 11, 2020 · 11 min · 2184 words · Vishal Chovatiya

Double Dispatch : Visitor Design Pattern in Modern C++

In software engineering, Behavioural Design Patterns deal with the assignment of responsibilities between objects. That in turn, make the interaction between the objects easy & loosely coupled. In this article of the design pattern series, we’re going to take a look at Visitor Design Pattern in Modern C++ which is also known as a classic technique for recovering lost type information(using Double Dispatch[TODO]). Visitor Design Pattern is used to perform an operation on a group of similar kind of objects or hierarchy....

April 2, 2020 · 10 min · 2108 words · Vishal Chovatiya