title: C++ - specialize class template's member function
body: <p>I am looking for help with templates. I need to create function in template what will be reacting differently on a specific type.</p>
  
  <p>It could looks like this:</p>
  
  <pre><code>template &lt;typename T&gt;
  class SMTH
  {
      void add() {...} // this will be used if specific function isn't implemented
      void add&lt;int&gt; {...} // and here is specific code for int
  };
  </code></pre>
  
  <p>I also tried to use <code>typeid</code> and <code>swich</code> through types in a single function, but doesn't work for me.</p>