Registered Member
|
Hey,
I was studying the implementation of the SparseMatrix class and its related classes (SparseMatrixBase, CompressedStorage, etc.). There is one thing I don't understand yet: The specialized struct traits<SparseMatrix<_Scalar, _Options, _Index> > is defined in the SparseMatrix header file. However, it is used in the implementation of SparseMatrixBase. When I implement a similar example I get an error: implicit instantiation of undefined template. Did I overlook something? Thanks. |
Moderator
|
struct traits is declared in Core/util/ForwardDeclarations.h, so it is known in advance when parsing SparseMatrixBase. Then the specialization of traits for SparseMatrix is parsed, and so it is known when instantiating SparseMatrixBase.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]