CRTP (Static Polymorphism)
Learn how CRTP can be used to change dynamic polymorphism into static polymorphism.
We'll cover the following...
We'll cover the following...
Dynamic polymorphism code
Let’s look at the same code that we used in the dynamic polymorphism section.
In the code above, we have the base class Person inherited by the derived class Student. We can see that the type print() function is called depending on the object type. This call to the print() function will be resolved at the runtime (dynamic polymorphism). Our job is to change ...