I'm making a class which will provide a common interface to two very different implementations. What do you think is the best design pattern to use to achieve this? What do you think about template polymorphism?
I'm currently looking into template polymorphism because I want to avoid the runtime overhead of normal polymorphism. It's also important that I simplify the usage of the class which I think I've achieved when you look at int main() below.
The implementation is obviously more complicated with templates, but that's not really an issue and I think the benefits of finding errors during compile-time versus runtime is worth it but I'm interested in what you have to say.
Here's a side-by-side comparison of the methods. If I have a terrible implementation, please feel free to say so.