title: Interface for template methods
body: <p>I have a class <code>Foo</code> that provides some sort of functionality. In order to maintain modularity, <code>Foo</code> is to be an interface (That is, a C++ class with only abstract methods), and an implementation of Foo can choose how exactly to implement the functionality. However, my interface includes a template method. That is, </p>
  
  <pre><code>class Foo
  {
  public:
          template&lt;class T&gt;
          void functionality(const T&amp;);
  };
  </code></pre>
  
  <p>It is impossible in <code>C++</code> to have template methods <code>virtual</code>. Is there any technique that can achieve a similar result (Modularity and Polymorphism) with template methods? </p>