Follow Us
Contribute
  • Register

Error C2738: (declaration) : is ambiguous or is not a member of (type)

0 votes

A function was declared incorrectly. Ex:


struct A {
   template <class T> operator T*();
};
 
template <>
A::operator int() {   // C2738

   return 0;
}

requested 7 years ago by errorbase (170,010 points)

2 Solutions

0 votes

This article is a derivative work based on http://msdn.microsoft.com/en-us/library/ca7k37at.aspx" title="http://msdn.microsoft.com/en-us/library/ca7k37at.aspx" target="_blank">Compiler Error C2738 which is provided by http://msdn.microsoft.com/en-us/library/60k1461a.aspx" title="http://msdn.microsoft.com/en-us/library/60k1461a.aspx" target="_blank">MSDN Community Content - Visual C++.

solved 7 years ago by errorbase (170,010 points)
0 votes

Possible resolutions:


struct A {
   template <class T> operator T*();
};
 
template <>

A::operator int*() {
   return 0;
}

struct A {
   template <class T> operator T();
};
 
template <>
A::operator int() {

   return 0;
}

solved 7 years ago by errorbase (170,010 points)

Related errors