I don't have a precise description of the problem so I'm just asking if this is possible (and if it is, some other information would be great).

A programmer told me you can avoid runtime overhead caused by virtual functions/polymorphism. He said to avoid the runtime overhead you can use templates in pattern called Curiously\_recurring\_template\_pattern which looks something like this:

```
class Derived : public Base<Derived>
{
  // ... implementation here
};

```

How does this Curiously-Recurring-Template-Pattern work?

How can one use Curiously-Recurring-Template-Pattern to substitute normal virtual functions/polymorphism?

Did I get it wrong?