Better alternative Run-Time Polymorphism in C++: A practical approach in OO design for machine intelligence
Singh Paras Nath, Singh Vikram, K. Anand · 2012
Main essence of polymorphism feature of Object Oriented Programming provided by the developer Bjarne Stroustrup in C++ is Run Time Polymorphism using virtual member functions in base classes. Base class pointer keeps the address of derived class object but during run-time it calls the base class function, even functions in base and derived classes have same signatures. To call the same function of derived class by base class pointer, we make the base class function as virtual to implement “Run-Time polymorphism”. Several papers by different authors including developer of C++ have come to solve the related complexities like “Object Slicing” and others. In this paper our motivation is to analyse and explore alternative adaptation by type identifier with polymorphic behaviour of type cast combining the overloading of insertion and extraction operators. Analysing the approaches we find a better alternative style of Run-Time Polymorphism that uses less memory than the existing virtual method techniques by comparable performance.