template terror
-
Hallo zusammen,
ich verzweifel mal wieder an templates und den verwirrenden VC++6 Fehlermeldungen.
Vielleicht versteht's ja einer von euch:template <class T> class GNode { /* ... */ protected: GNode(const GObject<T>&, bool copy = false); ~GNode(); /* ... */ protected: GObject<T>* object; list<GNode<T>*> children; }; template <class T> GNode<T>::~GNode() { for (list<GNode<T>*>::iterator i=children.begin(); i<children.end(); i++) // hier wird gemeckert delete *i; delete object; }
Fehlermeldung:
error C2784: 'bool __cdecl std::operator <(const class std::list<_Ty,_A> &,const class std::list<_Ty,_A> &)' : could not deduce template argument for 'const class std::list<_Ty,_A> &' from 'class std::list<class
GNode<int> *,class std::allocator<class GNode<int> *> >::iterator'(in main wird indirekt ein GNode<int> erstellt)
-
ändere das mal in den != Operator statt <
-
Oh, ähm... ja
Danke!