33#ifndef __ADS_ArrayQueue
34 #define __ADS_ArrayQueue
85 [[nodiscard]]
bool empty(
void )
const;
89 [[nodiscard]]
const T &
top(
void )
const;
123 [[nodiscard]] std::size_t
size(
void )
const;
151 std::ptrdiff_t( f_size ) ) );
162 [[nodiscard]]
bool fits(
void )
const;
164 std::unique_ptr< T[] > f_A;
167 std::size_t f_capacity;
179#include "ADS/queue/impl/ArrayQueue.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The iterators that the containers of the library have in common, beyond the book: they give a contain...
ArrayQueue(const ArrayQueue &other)
a copy of other, item by item, from the place 0 of a vector of the same capacity
const_iterator end(void) const
the iterator past the item at the back
Definition ArrayQueue.h:149
T Item
the type of the items
Definition ArrayQueue.h:66
std::size_t size(void) const
the number of items,
void swap(ArrayQueue &other) noexcept
exchanges the items and the capacities with other
const_iterator cend(void) const
as end()
Definition ArrayQueue.h:157
const_iterator begin(void) const
the iterator on the item at the front
Definition ArrayQueue.h:145
bool empty(void) const
true if there is no item, i.e.,
std::ptrdiff_t difference_type
the type of the distances
Definition ArrayQueue.h:138
void enqueue(const T &v)
puts at the back
const T & top(void) const
the item at the front,
std::size_t size_type
the type of the sizes
Definition ArrayQueue.h:137
CircularIterator< T > const_iterator
a constant iterator
Definition ArrayQueue.h:142
const T & reference
a constant reference
Definition ArrayQueue.h:139
T dequeue(void)
removes the item at the front and returns it
const_iterator cbegin(void) const
as begin()
Definition ArrayQueue.h:154
ArrayQueue & operator=(ArrayQueue other) noexcept
the items of other, by copy and swap
ArrayQueue(ArrayQueue &&other) noexcept
the items of other, which is left empty with no capacity
const T & const_reference
a constant reference
Definition ArrayQueue.h:140
T value_type
the type of the items
Definition ArrayQueue.h:136
std::size_t capacity(void) const
the maximum number of items,
CircularIterator< T > iterator
a constant iterator
Definition ArrayQueue.h:141
bool contains(const T &v) const
whether is in the queue,
ArrayQueue(std::size_t dim)
the empty queue of at most items
the random-access iterator on the items of a circular vector of the capacity whose first item is at ...
Definition Iterators.h:265