hit counter

Timeline

My development logbook

Item 39: Avoid Casts Down the Inheritance Hierarchy

It touches on the topic of downcasting (cast a derived class to its base class)

First of all, downcasting itself is usually unnecessary in most situation where the virtual functions are suffice.

If it must be done, use dynamic_cast. It will return null if cast is unsuccessful

OpenRTB

OpenRTB]

RTB stands for “Real-Time Bidding”

Item 36: Differentiate Between Inheritance of Interface and Inheritance of Implementation

The purpose of declaring a _pure virtual function_ is to have derived classes inherit a function interface only

The purpose of declaring a simple _virtual function_ is to have derived classes inherit a function interface as well as a default implementation.

The purpose of declaring a _nonvirtual function_ is to have derived classes inherit a function interface as well as a mandatory implementation.