Sobrecarga de operador amigo plantilla C ++
¿Qué tiene de malo mi código?
template<int E, int F>
class Float
{
friend Float<E, F> operator+ (const Float<E, F> &lhs, const Float<E, F> &rhs);
};
G ++ solo mantiene la advertencia:
float.h:7: warning: friend declaration ‘Float<E, F> operator+(const Float<E, F>&, const Float<E, F>&)’ declares a non-template function
float.h:7: warning: (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
lo intentéadd <> after the function name here
como se menciona en la nota de advertencia, pero g ++ me da un error.
Compilé el código con clang ++, estaba bien, sin advertencia alguna.