------- Comment #4 from jason dot hoos at syclo dot com  2008-06-30 16:32 
-------
(In reply to comment #1)
> Fix:
> 
> Do not overload a function before and after a template class
> using it.
> 

Another workaround (if rearranging the definitions isn't feasible): before any
of the function definitions, define a template function that calls the
function, and then use that template in other template definitions:

template <class X>
void tmplQHash(X x) { qHash(x); }

void qHash(double) {}

template <class T>
struct QSet
{
  void foo()
  {
    tmplQHash(T());
  }
};

void qHash(int*) {}

int main()
{
  QSet<double> s;
  s.foo(); // ok

  QSet<int*> sp;
  sp.foo(); // ok now
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31816

Reply via email to