44# ifndef TPL_DYNLISTQUEUE_H
45# define TPL_DYNLISTQUEUE_H
163 return put(std::forward<T>(data));
170 return put(std::forward<T>(data));
182 template <
typename...
Args>
185 return put(
T(std::forward<Args>(
args)...));
261 template <
class Operation>
268 template <
class Operation>
275 template <
class Operation>
282 template <
class Operation>
298 return this->
find_ptr([&key](
const T & item) {
return item == key; });
Variadic constructor macros for containers.
DRY (Don't Repeat Yourself) utilities and macros.
#define Special_Ctors(Set_Type, Type)
Generates special constructors for containers.
Iterator traits and STL-compatible iterator wrappers.
Dynamic queue of elements of generic type T based on single linked list.
const T & front() const
Return a const reference to the oldest item in the queue.
DynListQueue & operator=(const DynListQueue &rhs)
Assign to this a copy of rhs
T & put(const T &data)
The type of element.
bool traverse(Operation &&operation=Operation()) const
DynListQueue(DynListQueue &&__q) noexcept
Construct in constant time a queue from __q
T Key_Type
Key_Type is required by EqualToMethod mixin.
constexpr size_t size() const noexcept
Return the number of elements.
T get()
Remove the oldest item of the queue.
const T & rear() const
Return a const reference to the youngest item in the queue.
bool traverse(Operation &operation) const
void swap(DynListQueue &__q) noexcept
Swap this with __q in constant time.
void empty() noexcept
Empty the queue.
T & put(T &&data)
Put an item by moving.
T & front()
Return a modifiable reference to the oldest item in the queue.
const T * search(const T &key) const noexcept
bool traverse(Operation &&operation=Operation())
bool traverse(Operation &operation)
Traverse all the elements from the oldest (front) to the youngest (rear) and execute operation on eac...
void clear() noexcept
Alias for empty() - clears all items from the queue.
T pop()
Alias for get() - removes and returns the front item.
T & insert(const T &data)
T & append(const T &data)
T & emplace(Args &&... args)
Construct an item in place at the rear of the queue.
DynListQueue() noexcept
Construct an empty queue.
DynListQueue(const DynListQueue &__q)
Construct a copy of __q
T Item_Type
The type of set.
T & rear()
Return a modifiable reference to the youngest item in the queue.
T * search(const T &key) noexcept
Search for an item in the queue using equality comparison.
bool is_empty() const noexcept
Return true if this is empty.
Iterator on the items of list.
Dynamic singly linked list with functional programming support.
T & append(const T &item)
Append a new item by copy.
T & get_last() const
Return the last item of the list.
T & get_first() const
Return the first item of the list.
void empty() noexcept
empty the list
DynList & swap(DynList &l) noexcept
Swap this with l.
constexpr bool is_empty() const noexcept
Return true if list is empty.
Equality test for containers.
Common methods to the Aleph-w ( ) containers.
Aleph::DynList< __T > maps(Operation &op) const
Map the elements of the container.
Common sequential searching methods on containers.
T * find_ptr(Operation &operation) noexcept(operation_is_noexcept< Operation >())
Find a pointer to an item in the container according to a searching criteria.
Mixin that adds STL begin()/end() and cbegin()/cend() to Aleph containers.
Singly linked list implementations with head-tail access.
Main namespace for Aleph-w library functions.
std::decay_t< typename HeadC::Item_Type > T
Iterator on elements of a queue.
typename DynList< T >::Iterator Base
Iterator(const DynListQueue< T > &q) noexcept
Generic list of items stored in a container.
bool traverse(Operation &operation) noexcept(traverse_is_noexcept< Operation >())
Traverse the container via its iterator and performs a conditioned operation on each item.
Dynamic doubly linked list implementation.