I recently saw the following C++ code-snippet
template
class A : public B
{
...
};
and I am wondering in which setting such
It's often used to realize static polymorphism.
Use cases are:
In general you have the benefits from dynamic polymorphism, without the extra runtime costs of virtual functions. But it's only useful if the concrete type can be determined at compile time.