how to solve following problem in C++?
<p>I have one template function which will take a pointer type and i have instantiated it before calling.
i have written function with its dummy implementation as follows:</p>

<pre><code>template&lt;T&gt;fun_name( const T *p )
{
  //written functionality which will give me class name that i will store into string Variable
  e.g. i got output like this string Var = "First_class" or string Var = "Second_class"   

  //Using this class name i will call one function of that class
    if(Var == "Fisrt_class") 
    {   
    First_class::static_function_name(p);
    }
    if(Var == "Second_class")
    { 
    Second_class::static_function_name(p);
    }

}
</code></pre>

<p>and in global scope i instantiated this function for two variables as like below:</p>

<pre><code>template&lt;first_class&gt;static_function_name(const First_class *)
template&lt;Second_class&gt;static_function_name(const Second_class *)
</code></pre>

<p>above code gives me error that </p>

<pre><code>error: no matching function call in Second_class::static_function_class(const Fisrt_class*)
error: no matching function call in First_class::static_function_class(const Second_class*)
</code></pre>

<p>thanks in advance!</p>
