title: template class and overloading '=='
body: <p>I'm making some stack, in which I need to uses this kind of comparison in some function. But I got stuck since I don't know how the prototype for this should look like.</p>
  
  <p>I have the following line in a function.</p>
  
  <pre><code>template &lt;class T&gt;
  void function1(T i)
  {
     if(i == 'a')
         //do something
  }
  </code></pre>
  
  <p>I wonder know how the overload prototype should look like for it?</p>
  
  <p><strong>EDIT</strong>
  Dunno if it's worth to mention, anyway this is what I have tried so far
  template </p>
  
  <pre><code>bool Stack&lt;T&gt;::operator==(char c) const
  {
      cout &lt;&lt; c &lt;&lt; endl; // just some test
  }
  </code></pre>
  
  <p>No need to comment how this function works, as I have not finished it yet. This part will compile, however at the part where I call this function for the first time is in the Stack::push(T i). The compiler will complain that there are no matching function for this.</p>
  
  <pre><code> error: no match for 'operator==' in 'i == '#''
  </code></pre>