I'm building a matrix template. There are operators, functions and all work fine. Except when I try to convert a double type matrix to int type matrix (or vice versa). = operator cannot be defined so its not possible to override it for basic_Matrix2D and basic_Matrix2D external to class. I know I can write in class = operators to convert from but in this case there will be two = operator with same parameters. When using double as template parameter converting from double will be the same as converting from template parameter. Class definition is follows, codes can be accessed from SourceForge
template <class _T> class basic_Matrix2D {
}
There is also another problem I remembered about templates, converting to template type pointer works while converting to template type does not. This might be compiler specific. observe:
operator _T() {
return something;
}
operator _T*() {
return somethingelse;
}
Thanks in advance,
Cem