Se ho questa classe template con queste funzioni friend all'interno:
E ricevo questi warning:template<class T> class array
{
friend ostream& operator<< (ostream&,const array<T> );
friend istream& operator>> (istream&,array<T>& ) ;
};
29 D:\Documenti\Template.cpp [Warning] friend declaration `std:stream& operator<<(std:
stream&, array<T>)' declares a non-template function
30 D:\Documenti\Template.cpp [Warning] friend declaration `std::istream& operator>>(std::istream&, array<T>& )' declares a non-template function
29 D:\Documenti\Template.cpp [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
Che cosa dovrei fare? Ho capito che dovrei aggiungere <> prima del nome della funzione, e poi che "-Wno-non-template-friend" disabilita questi warning, ma non so dove metterlo...
Se faccio solo la prima cosa, quella delle <>, aumentano gli errori altro che risolversi!