This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problems with template template parameter


Hi Alexander,

Hmmm, Oliver must be on to something there! The intricacies of templates.

Is this an option for your problem domain...

template<int rows, int cols>
class Matrix {
public:
Matrix() {
cout << __PRETTY_FUNCTION__ << endl;
}

template<int cols2>
Matrix<rows, cols2>* operator * (Matrix<cols, cols2>& lhs) {
cout << __PRETTY_FUNCTION__ << endl;
}

};

Gets rid of having a Matrix_Base, which avoids the specialization issue you bumped into.

--Eljay

PS: Thanks for __PRETTY_FUNCTION__ ... I was not aware of it before!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]