src/data-structures/queue.h
// Retrieve and remove head of the queue
Retrieve and remove head of the queue
Retrieve and remove head of the queue
T pop() {
        T value = _head->value;
        auto next = _head->next;
        delete _head;
        _head = next;
        if (_head == nullptr) {
            _tail = nullptr;
        }
        return value;
    }
T pop ( ) { T value = _head -> value ; auto next = _head -> next ; delete _head ; _head = next ; if ( _head == nullptr ) { _tail = nullptr ; } return value ; }
Retrieve and remove head of the queue
Retrieve and remove head of the queue