title: Operator- overloading (same parameters, different return type)
body: <p>How do I overload the minus operator accepting the same number of parameters, but having different return types?</p>
  
  <p>Template class:</p>
  
  <pre><code>template &lt;typename T&gt;
  T minus (T x, T y) {
      return (x - y);
  }
  
  template &lt;typename T&gt;
  double absMinus (T x, T y) {
      double sd = abs(x - y);
      return sd;
  }
  </code></pre>
  
  <p>Operator overloading class:</p>
  
  <pre><code>Minus operator-(Minus &amp;p, Minus &amp;q) {
      return (p.something - q.something);
  }
  
  double operator-(Minus &amp;p, Minus &amp;q) {
      return (p.something() - q.something());
  }
  </code></pre>
  
  <p>When I tried to compile, it gave me the following error:</p>
  
  <pre><code>Minus.h:25: error: new declaration ‘double operator-(Minus&amp;, Minus&amp;)’
  Minus.h:24: error: ambiguates old declaration ‘Minus operator-(Minus&amp;, Minus&amp;)’
  </code></pre>