------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-22 
15:17 -------
the error message about ambiguous overload is correct as there are two 
functions there.
operator* in the global namespace and operator* in the NS namespace.
You most likely wanted to implement operator* in the NS namespace and not a new 
one in the global 
namespace.

The following code does what you wanted to do:
// Barebones code to reproduce the problem: 
// Interface 
namespace NS
{
    template<typename T> class X {};

    template<typename T> X<T> operator*(const X<T> &a, const X<T> &b);
}

// Implementation 
template<typename T>
NS::X<T>NS::operator*(const NS::X<T> &a,const NS::X<T> &b)
{
    return NS::X<T>();
}

// Application 
int main(int argc, char *argv[])
{
    NS::X<int> tmp = NS::X<int>() * NS::X<int>();
}

Notice how I wrote the Implementation.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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

Reply via email to