I have a set of classes that implement the same business methods. I plan to use CRTP instead of virtual dispatch due to performance reasons. But I'd like to keep the convenience of coding to a single interface that comes with inheritance and virtual methods.
Is it ok to have my specialised classes inherit from both a templated abstract class that would use CRTP to hold common code, and also inherit from a pure virtual class so I can then create instances of each type but have my client code depend only on the interface?
I'm asking because I've looked for something like this and can't find anything similar.
Aucun commentaire:
Enregistrer un commentaire