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