c++.windows.32-bits - template stuff
- Robert M. Münch (24/24) Nov 20 2002 Hi, I have the following code from an include file:
- Jan Knepper (6/24) Nov 20 2002 To me it looks like your CUserThesaurusItem or whatever the 'get' member
Hi, I have the following code from an include file: template <class Type> int DArrayAsVector<Type>::operator==(const DArrayAsVector<Type>& other) { if (count != other.count) return false; for (int i = 0; i < count; ++i) if (!(get(i) == other.get(i))) return false; return true; } And I get this error message: d:\develop\dtsearch\include\darray.h(189) : Error: illegal operand types Had: CUserThesaurusItem and: CUserThesaurusItem The template code look syntactically correct to me. But I really don't have a clue what the error might be. Further I didn't found any instantiation of the template with CUserThesaurusItem somewhere in the list file... Any idea what the problem could be? -- Robert M. Münch IT & Management Freelancer Mobile: +49 (0)177 2452 802 Fax : +49 (0)721 8408 9112 Web : http://www.robertmuench.de
Nov 20 2002
To me it looks like your CUserThesaurusItem or whatever the 'get' member returns is missing an operator. bool operator == ( const CUserThesaurusItem & ) const; (or the ~const version). Jan "Robert M. Münch" wrote:Hi, I have the following code from an include file: template <class Type> int DArrayAsVector<Type>::operator==(const DArrayAsVector<Type>& other) { if (count != other.count) return false; for (int i = 0; i < count; ++i) if (!(get(i) == other.get(i))) return false; return true; } And I get this error message: d:\develop\dtsearch\include\darray.h(189) : Error: illegal operand types Had: CUserThesaurusItem and: CUserThesaurusItem The template code look syntactically correct to me. But I really don't have a clue what the error might be. Further I didn't found any instantiation of the template with CUserThesaurusItem somewhere in the list file... Any idea what the problem could be?
Nov 20 2002