Good day. There is a template class:
template<class T> class List { struct Node { T elem; Node* next; Node* prev; Node(); }; int count; Node* head; Node *tail; public: // ΠΌΠ΅ΡΠΎΠ΄Ρ }; Also, I have a nested regular iterator class:
class Iterator { Node* element; public: // ΠΠΎΠ½ΡΡΡΡΠΊΡΠΎΡΡ ΠΈ ΠΏΠ΅ΡΠ΅Π³ΡΡΠ·ΠΊΠΈ Iterator(const Iterator&); // ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΡ ΠΈΡΠ΅ΡΠ°ΡΠΎΡΠΎΠΌ Iterator(Node*); // ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·Π°ΡΠΈΡ ΡΠ·Π»ΠΎΠΌ Iterator& operator=(Node* node) // ΠΏΡΠΈΡΠ²ΠΎΠ΅Π½ΠΈΠ΅ ΡΠ·Π»Π° { if (*this == &node) return *this; this->elem = node; return *this; } // ΠΠ°Π½ΠΈΠΏΡΠ»ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ bool hasNext(); // Π΅ΡΡΡ Π»ΠΈ ΡΠ»Π΅Π΄ΡΡΡΠΈΠΉ bool hasPrev(); // Π΅ΡΡΡ Π»ΠΈ ΠΏΡΠ΅Π΄ΡΠ΄ΡΡΠΈΠΉ T next(); // ΠΊ ΡΠ»Π΅Π΄ΡΡΡΠ΅ΠΌΡ T prev(); // ΠΊ ΠΏΡΠ΅Π΄ΡΠ΄ΡΡΠ΅ΠΌΡ }; Simple class. How to bring the implementation of the overloaded operator = out of the Iterator class beyond its limits, and the limits of the List class? Tried a lot of things, the errors are rather strange: Error C2143 syntax error: the absence of a ";" before "{"
Thanks in advance!