20#ifndef BEAST_INTRUSIVE_LIST_H_INCLUDED
21#define BEAST_INTRUSIVE_LIST_H_INCLUDED
27template <
typename,
typename>
34template <
typename T,
typename U>
42template <
typename T,
typename U>
55template <
typename T,
typename Tag>
61 friend class List<T, Tag>;
97 return m_node == other.m_node;
100 template <
typename M>
104 return !((*this) == other);
277template <
typename T,
typename Tag =
void>
436 Node* node =
static_cast<Node*
>(&element);
437 node->m_next = &*pos;
438 node->m_prev = node->m_next->m_prev;
439 node->m_next->m_prev = node;
440 node->m_prev->m_next = node;
455 Node* before = &*pos;
456 other.m_head.m_next->m_prev = before->m_prev;
457 before->m_prev->m_next = other.m_head.m_next;
458 other.m_tail.m_prev->m_next = before;
459 before->m_prev = other.m_tail.m_prev;
475 node->m_next->m_prev = node->m_prev;
476 node->m_prev->m_next = node->m_next;
581 return *(
static_cast<pointer>(node));
Intrusive doubly linked list.
value_type const * const_pointer
iterator iterator_to(T &element) const noexcept
Obtain an iterator from an element.
detail::ListIterator< Node const > const_iterator
iterator push_back(T &element) noexcept
Append an element at the end of the list.
const_iterator begin() const noexcept
Obtain a const iterator to the beginning of the list.
List & operator=(List const &)=delete
const_iterator cend() const noexcept
Obtain a const iterator to the end of the list.
reference front() noexcept
Obtain a reference to the first element.
void clear() noexcept
Clear the list.
void insert(iterator pos, List &other) noexcept
Insert another list into this one.
iterator begin() noexcept
Obtain an iterator to the beginning of the list.
const_reference back() const noexcept
Obtain a const reference to the last element.
detail::ListIterator< Node > iterator
iterator insert(iterator pos, T &element) noexcept
Insert an element.
iterator append(List &list) noexcept
Append another list at the end of this list.
iterator end() noexcept
Obtain a iterator to the end of the list.
const_reference element_from(Node const *node) const noexcept
const_reference front() const noexcept
Obtain a const reference to the first element.
reference back() noexcept
Obtain a reference to the last element.
const_iterator end() const noexcept
Obtain a const iterator to the end of the list.
T & pop_back() noexcept
Remove the element at the end of the list.
typename detail::ListNode< T, Tag > Node
bool empty() const noexcept
Determine if the list is empty.
void swap(List &other) noexcept
Swap contents with another list.
const_iterator const_iterator_to(T const &element) const noexcept
Obtain a const iterator from an element.
List(List const &)=delete
T & pop_front() noexcept
Remove the element at the beginning of the list.
iterator push_front(T &element) noexcept
Insert an element at the beginning of the list.
value_type const & const_reference
size_type size() const noexcept
Returns the number of elements in the list.
const_iterator cbegin() const noexcept
Obtain a const iterator to the beginning of the list.
List()
Create an empty list.
reference element_from(Node *node) noexcept
iterator erase(iterator pos) noexcept
Remove an element.
iterator prepend(List &list) noexcept
Insert another list at the beginning of this list.
ListIterator & operator++() noexcept
ListIterator & operator--() noexcept
reference operator*() const noexcept
ListIterator operator++(int) noexcept
typename beast::detail::CopyConst< N, typename N::value_type >::type value_type
void decrement() noexcept
reference dereference() const noexcept
ListIterator operator--(int) noexcept
bool operator!=(ListIterator< M > const &other) const noexcept
pointer operator->() const noexcept
bool operator==(ListIterator< M > const &other) const noexcept
void increment() noexcept
ListIterator(ListIterator< M > const &other) noexcept
ListIterator(N *node=nullptr) noexcept
typename std::remove_const< U >::type const type
Copy const attribute from T to U if present.
typename std::remove_const< U >::type type