Can calling this method in a loop cause a stack overflow? And if so, how to solve it?
Queue Queue::operator <<(Time &time) { Element *temp = new Element; temp->time = time; temp->next = NULL; if (head != NULL) { tail->next = temp; tail = temp; } else head = tail = temp; size++; return *this; }
Element *temp, which when exited is immediately destroyed and so will be in a circle. - Alex Krass