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)...));
265 template <
class Operation>
272 template <
class Operation>
279 template <
class Operation>
286 template <
class Operation>
302 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
Empties the container.
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)
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
constexpr bool is_empty() const noexcept
Equality test for containers.
Common methods to the Aleph-w ( ) containers.
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 criterion.
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.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
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.