C
Christophe Barbe
I am not clear about friend functions of a template class.
GCC (3.3.2) wants me to add <> after the friend function names in the
class declaration and VisualC++ doesn't like that.
template <class T>
class test{
test(void);
~test(void);
friend bool operator== <> (const test<T> &p1, const test<T> &p2);
}
If I don't add <> I get from GCC the following warning:
"friend declaration `bool operator==(const test<T>&,
const test<T>&)' declares a non-template function
(if this is not what you intended, make sure the function
template has already been declared and add <> after the function name
here) -Wno-non-template-friend disables this warning"
Can someone explain me what I am missing?
Thanks,
Christophe
GCC (3.3.2) wants me to add <> after the friend function names in the
class declaration and VisualC++ doesn't like that.
template <class T>
class test{
test(void);
~test(void);
friend bool operator== <> (const test<T> &p1, const test<T> &p2);
}
If I don't add <> I get from GCC the following warning:
"friend declaration `bool operator==(const test<T>&,
const test<T>&)' declares a non-template function
(if this is not what you intended, make sure the function
template has already been declared and add <> after the function name
here) -Wno-non-template-friend disables this warning"
Can someone explain me what I am missing?
Thanks,
Christophe