Does static polymorphism make sense for implementing an interface?
and Merry Christmas everybody! I am learning about static polymorphism and I'm reading Andrei Alexandrescu's excellent book on policy-based design. I came across the following, in my code: I have interface Interface which specifies that method Foo must be present. This interface will be implemented by class Impl . I have the following two options: 1) Dynamic polymorphism class Interface { public: virtual void Foo() = 0; } class Impl : public Interface { public: void Foo() {}; } 2) Static polymorphism class Impl { { public: void Foo() {}; } template <class I> class Interface : public I { public