A memoria una cosa del genere.
Il friend è necessario per accedere ai membri interni.
Attenzione che la funzione non sarà istanziata dal compilatore finchè non verrà usata.
codice:
template< typename mType , unsigned int r = 1 ,unsigned int c = 1>
class Matrix
{
	
	template<typename T , unsigned int N , unsigned int M>
	friend std::ostream& operator<< ( std::ostream& , Matrix<T,N,M>& );

	template<typename U , unsigned int Rows , unsigned int Cols>
	friend class Matrix<U,Rows,Cols>;

      public:
	template<typename U , unsigned int Rows , unsigned int Cols>
	Matrix& operator=(const Matrix<U,Rows,Cols>& );
...
}

template< typename mType , unsigned int r ,unsigned int c>
template<typename U , unsigned int Rows , unsigned int Cols>
inline Matrix<mType,r,c>& Matrix<mType,r,c>::operator=(const Matrix<U,Rows,Cols>& rhs) {
...
}