Template Class RingDeque

Class Documentation

template<class T>
class RingDeque

a double ended queue on a circular vector of 2^k places that doubles

Public Types

using value_type = T
using size_type = std::size_t
using difference_type = std::ptrdiff_t
using reference = T&
using const_reference = const T&
using iterator = detail::MaskIterator<T, false>
using const_iterator = detail::MaskIterator<T, true>
using reverse_iterator = std::reverse_iterator<iterator>
using const_reverse_iterator = std::reverse_iterator<const_iterator>

Public Functions

RingDeque(void) = default
RingDeque(std::initializer_list<T> l)

the items of l, in order

RingDeque(const RingDeque &o)
RingDeque(RingDeque &&o) noexcept

the vector of o, which is left empty with no capacity

RingDeque &operator=(RingDeque o) noexcept
~RingDeque()
void swap(RingDeque &o) noexcept
inline bool empty(void) const
inline std::size_t size(void) const
inline std::size_t capacity(void) const

the places, 0 or a power of 2

void reserve(std::size_t n)

at least n places

T &front(void)
Pre:

the deque is not empty

const T &front(void) const
T &back(void)
const T &back(void) const
T &operator[](std::size_t i)

the item of rank i from the front

Pre:

i < size()

const T &operator[](std::size_t i) const
inline void push_back(const T &v)
inline void push_back(T &&v)
inline void push_front(const T &v)
inline void push_front(T &&v)
template<class ...Args>
T &emplace_back(Args&&... args)

the item built from args at the back

Post:

one item more, the new one at the back

template<class ...Args>
T &emplace_front(Args&&... args)

the item built from args at the front

Post:

one item more, the new one at the front

void pop_front(void)
Pre:

the deque is not empty

Post:

one item less

void pop_back(void)
Pre:

the deque is not empty

Post:

one item less

void clear(void)

removes all the items, the places kept

bool operator==(const RingDeque &o) const
inline iterator begin(void)
inline iterator end(void)
inline const_iterator begin(void) const
inline const_iterator end(void) const
inline const_iterator cbegin(void) const
inline const_iterator cend(void) const
inline reverse_iterator rbegin(void)
inline reverse_iterator rend(void)
inline const_reverse_iterator rbegin(void) const
inline const_reverse_iterator rend(void) const