#include "List/List.h" #include template class CircleList: public List { public: Node* get_start() { return start; } void add(T value) { Node* node = new Node; node->value = value; if(start==nullptr) { start = node; end = node; return; } node->prev = end; node->next = start; end = node; lenght++; } void pop() { end->prev->next = start; end = end->prev; lenght--; } friend std::ostream &operator <<(std::ostream &os, CircleList &c) { os << "( "; Node* currentNode = c.start; while (currentNode->next!=nullptr) { os << currentNode->value << " = "; currentNode = currentNode->next; } os << currentNode->value << " )"; return os; } };