I've got a problem with template classes. I have a base class Matrix, from which a dense and a sparse matrix are derived (all three of them are templates). Now I'd like to write a copy operator from the dense to the sparse matrix, and from the sparse to the dense matrix. Since the implementation has to go into the header, I end up with a cyclic inclusion of SparseMatrix.h in DenseMatrix.h and DenseMatrix.h ind SparseMatrix.h, which does not compile.
Any ideas how to solve this problem?