#include "FifoElement.hpp" template class Fifo { FifoElement* head; FifoElement* tail; public: /*Fifo& operator<<(const T&) { push(T); }; Fifo& operator>>(const T&); operator int() const;*/ Fifo() { head = nullptr; tail = nullptr; } void push(T input) { FifoElement* element = new FifoElement; element->value = input; element->next = nullptr; if (head == nullptr) { head = element; } if (tail) { tail->next = element; } tail = element; } T pop() { if (!head) { throw "Fifo Unterlauf"; } if (tail == head) { T tmp = tail->value; tail = 0; return tmp; } FifoElement* temp = head; head = head->next; T deleted = temp->value; return deleted; } void show() { FifoElement* temp = head; do { cout << temp->value << endl; temp = temp->next; } while (temp); } };