title: Method name same as template method name in C++
body: <p>To my surprise this program compiles in both MSCV and GCC:</p>
  
  <pre><code>class A
  {
  public:
    int add() { return 0; }
    template&lt;typename T&gt;
    T add() { return T(); }
  };
  
  int main() { 
    A a;
    a.add();
    a.add&lt;int&gt;();
    return 0; 
  }
  </code></pre>
  
  <p>Obviously, due to the fact that the type of the templated method cannot be deduced and needs to be explicitly stated, so the situation isn't ambigious - still it seems a bit shady - if it were a non-templated method that would be obviously incorrect.</p>
  
  <p>I've tried googling and looking through the last draft of the standard, but couldn't find the answer - is same naming of a template method and a normal method that only differ by return type legal in C++, or are the compilers just being permissive?</p>