91# include <type_traits>
182 Dnode() noexcept(
std::is_nothrow_default_constructible_v<
T>)
185 static_assert(std::is_default_constructible<T>::value,
186 "No default constructor for T");
192 static_assert(std::is_copy_constructible<T>::value,
193 "No copy constructor for T");
199 static_assert(std::is_move_constructible<T>::value,
200 "No move constructor for T");
216 static_assert(std::is_copy_constructible<T>::value,
217 "No copy constructor for T");
225 Dnode(
Dnode && node)
noexcept requires std::is_nothrow_move_constructible_v<T>
226 :
Dlink(std::move(node)),
data(std::move(node.data))
243 Dnode(
Dnode && node)
requires (not std::is_nothrow_move_constructible_v<T>)
252 static_assert(std::is_copy_assignable<T>::value,
253 "No copy assign for T");
261 std::swap(
data, p.data);
285 char * addr =
reinterpret_cast<char *
>(&
data);
342 return static_cast<Dnode<T>*
>(
this);
347 return static_cast<const Dnode<T>*
>(
this);
357 return to_dnode<T>()->get_data();
Exception handling system with formatted messages for Aleph-w.
#define ah_underflow_error_if(C)
Throws std::underflow_error if condition holds.
Standard functor implementations and comparison objects.
Dlink * get_curr() const
Return the current node of iterator.
Dlink * del()
Remove from the list the current node and move the iterator one position forward.
Dlink * get_curr_ne() const noexcept
Return the current link guaranteeing no exception. Be careful.
Dlink * del_ne() noexcept
Remove from the list the current node and move the iterator one position forward, without checking th...
Doubly linked circular list node.
constexpr bool is_empty() const noexcept
Return true if this (as header node) is empty.
T & to_data() noexcept
Return the item of the Dnode<T> whose link is this.
Dlink() noexcept
Initialize a node or an empty list.
void swap(Dlink *link) noexcept
Swap this with list whose header is link.
Dnode< T > * to_dnode() noexcept
Convert this, which must be the link of a Dnode<T>, to that node.
Dlink * remove_prev() noexcept
Remove the item that is before this
Dlink * remove_next() noexcept
Remove the item that is after this
Iterator on a list of Dnode objects.
Dnode< T > * get_curr_ne() const noexcept
Return the current link guaranteeing no exception. Be careful.
Dnode * del_ne() noexcept
Same as del() but without exception check.
Dnode * del()
Remove the current node of the list a return a pointer to the removed node.
Dnode< T > * get_curr() const
Return a pointer to the current node.
Node belonging to a double circular linked list with header node.
Dnode< T > *& get_next() const noexcept
Return the next node to this
Dnode< T > *& get_first() const
Get the first node.
Dnode< T > * remove_first()
Remove the first node and return its address.
Dnode< T > * remove_next() noexcept
Remove the next node to this; return its address.
Dnode< T > * remove_first_ne() noexcept
Remove the first node and return its address.
Dnode(Dnode &&node) noexcept
Move constructor: takes the place of node in its list and moves its item, which cannot throw.
Dnode< T > * remove_last()
Remove the last node and return its address.
const T & get_data() const noexcept
Return a modifiable reference to the data contained in the node.
Dnode(Dnode &&node)
Move constructor for an item whose move may throw: moves the item of node and then takes its place in...
Dnode & operator=(const Dnode &p)
Copy assigment.
Dnode & swap(Dnode &p)
Swap this with p
Dnode(T &&item)
Construct a new node with the item moved.
Dnode(const Dnode &node)
Copy constructor.
T & get_key() noexcept
See get_data().
Dnode< T > *& get_first_ne() const noexcept
Get the first node.
Dnode() noexcept(std::is_nothrow_default_constructible_v< T >)
Construct a node, or the header of an empty list, whose item is T(): zero for an arithmetic type or a...
Dnode(const T &item)
Construct a node with a copy of item
Dnode< T > *& get_prev() const noexcept
Return the previous node to this
Dnode< T > * remove_last_ne() noexcept
Remove the last node and return its address.
Dnode< T > *& get_last_ne() const noexcept
Get the last node.
static Dnode * data_to_node(T &data) noexcept
Given an reference to the data in the node, returns a pointer to the Dnode object that contains it.
T & get_data() noexcept
Return a modifiable reference to the data contained in the node.
Dnode< T > * remove_prev() noexcept
Remove the previous node to this; return its address.
Dnode< T > *& get_last() const
Get the last node.
const T & get_key() const noexcept
See get_data().
Doubly linked circular list implementation.
const long double offset[]
Offset values indexed by symbol string length (bounded by MAX_OFFSET_INDEX)
Main namespace for Aleph-w library functions.
std::decay_t< typename HeadC::Item_Type > T