title: Mismatch in formal parameter list while compiling template function
body: <p>I'm getting compile time error while compiling templated function, the error is:</p>
  
  <blockquote>
    <p>error C2563 : mismatch in formal parameter list</p>
  </blockquote>
  
  <p>Can't figure out where the problem is, compiler doesn't tell much, do you see what the problem could be?</p>
  
  <pre><code>#include &lt;cmath&gt;    // temporary
  #include &lt;iostream&gt;
  #include &lt;cassert&gt;
  
  namespace math
  {
      //
      // Power function
      //
      template&lt;typename Exp&gt;
      double pow(double base, Exp exponent)
      {
          assert(!(base == 0 &amp;&amp; exp &lt;= 0));
  
          if (base == 0)
              return 0;
  
          if (exponent == 0 || base == 1)
              return 1;
  
          if (exponent == 1)
              return base;
  
          if (exponent &lt; 0)
              return 1 / pow(base, -exponent);
  
          return base * pow(base, exponent - 1);
      }
  
      //
      // Power specialization for real exponents
      //
      template&lt;&gt;
      double pow(double base, double exponent)
      {
          // TODO: handle real negative exponents
          return exp(exponent * log(base));
      }
  }
  
  int main()
  {
      // error C2563:  mismatch in formal parameter list
      std::cout &lt;&lt; "pow" &lt;&lt; std::endl;
      std::cout &lt;&lt; math::pow(1, 2) &lt;&lt; std::endl;
      std::cout &lt;&lt; math::pow(0, 2) &lt;&lt; std::endl;
      std::cout &lt;&lt; math::pow(2, 0) &lt;&lt; std::endl;
      std::cout &lt;&lt; math::pow(3, -4) &lt;&lt; std::endl;
  
      return 0;
  }
  </code></pre>