Template Class LinkedQueue

Nested Relationships

Nested Types

Class Documentation

template<class T>
class LinkedQueue

a QUEUE realized as a singly linked list with a front and a back

Public Types

using Item = T

the type of the items

using value_type = T
using size_type = std::size_t
using difference_type = std::ptrdiff_t
using reference = const T&
using const_reference = const T&
using iterator = LinkedIterator<Cell, T, &Cell::next, &Cell::value>
using const_iterator = LinkedIterator<Cell, T, &Cell::next, &Cell::value>

Public Functions

LinkedQueue(void) = default
LinkedQueue(const LinkedQueue &other)
LinkedQueue(LinkedQueue &&other) noexcept

the cells of other, which is left empty

LinkedQueue &operator=(LinkedQueue other) noexcept
~LinkedQueue()
void swap(LinkedQueue &other) noexcept
bool empty(void) const
void enqueue(const T &v)

puts v at the back

Post:

the queue is not empty, and v is at the front if it was empty

T dequeue(void)

removes the item at the front and returns it

Pre:

the queue is not empty

const T &top(void) const

the item at the front

Pre:

the queue is not empty

std::size_t size(void) const

the number of items, O( 1 )

bool operator==(const LinkedQueue &o) const

the same items in the same order

inline const_iterator begin(void) const
inline const_iterator end(void) const
inline const_iterator cbegin(void) const
inline const_iterator cend(void) const