cycle_ptr
|
Intrusive linked list. More...
#include <llist.h>
Classes | |
class | const_iterator |
Const iterator for llist. More... | |
class | iterator |
Iterator for llist. More... | |
Public Types | |
using | value_type = T |
Value type of the list. | |
using | reference = T & |
Reference type of the list. | |
using | const_reference = const T & |
Const reference type of the list. | |
using | pointer = T * |
Pointer type of the list. | |
using | const_pointer = const T * |
Const pointer type of the list. | |
using | size_type = std::uintptr_t |
Size type of the list. | |
using | reverse_iterator = std::reverse_iterator< iterator > |
Reverse iterator type. | |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
Reverse const_iterator type. | |
Public Member Functions | |
llist () noexcept | |
Default constructor. | |
llist (const llist &)=delete | |
auto | operator= (const llist &) -> llist &=delete |
llist (llist &&other) noexcept | |
Move constructor. | |
template<typename Iter > | |
llist (Iter b, Iter e) | |
Range constructor. More... | |
~llist () noexcept | |
Destructor. More... | |
auto | empty () const noexcept -> bool |
Test if this list is empty. More... | |
auto | size () const noexcept -> size_type |
Compute the size of the list. More... | |
auto | clear () noexcept -> void |
Unlink all elements from the list. | |
auto | front () -> T & |
Reference to first item in this list. More... | |
auto | front () const -> const T & |
Reference to first item in this list. More... | |
auto | back () -> T & |
Reference to last item in this list. More... | |
auto | back () const -> const T & |
Reference to last item in this list. More... | |
auto | begin () noexcept -> iterator |
Return iterator to first element in the list. | |
auto | begin () const noexcept -> const_iterator |
Return iterator to first element in the list. | |
auto | cbegin () const noexcept -> const_iterator |
Return iterator to first element in the list. | |
auto | end () noexcept -> iterator |
Return iterator past the last element in the list. | |
auto | end () const noexcept -> const_iterator |
Return iterator past the last element in the list. | |
auto | cend () const noexcept -> const_iterator |
Return iterator past the last element in the list. | |
auto | rbegin () noexcept -> reverse_iterator |
Return iterator to first element in reverse iteration. | |
auto | rbegin () const noexcept -> const_reverse_iterator |
Return iterator to first element in reverse iteration. | |
auto | crbegin () const noexcept -> const_reverse_iterator |
Return iterator to first element in reverse iteration. | |
auto | rend () noexcept -> reverse_iterator |
Return iterator past the last element in reverse iteration. | |
auto | rend () const noexcept -> const_reverse_iterator |
Return iterator past the last element in reverse iteration. | |
auto | crend () const noexcept -> const_reverse_iterator |
Return iterator past the last element in reverse iteration. | |
auto | push_back (T &v) noexcept -> void |
Link element into the list, as the last item. More... | |
auto | push_front (T &v) noexcept -> void |
Link element into the list, as the first item. More... | |
auto | insert (const_iterator pos, T &v) noexcept -> iterator |
Link element into the list. More... | |
template<typename Iter > | |
auto | insert (const_iterator pos, Iter b, Iter e) -> iterator |
Link multiple elements into the list. More... | |
auto | pop_front () -> T & |
Unlink the first element in the list. More... | |
auto | pop_back () -> T & |
Unlink the last element in the list. More... | |
auto | erase (const_iterator b) -> iterator |
Erase element from the list. More... | |
auto | erase (const_iterator b, const_iterator e) -> iterator |
Erase elements from the list. More... | |
auto | splice (const_iterator pos, llist &other) noexcept -> void |
Splice elements from list. More... | |
auto | splice (const_iterator pos, llist &other, const_iterator elem) noexcept -> void |
Splice elements from list. More... | |
auto | splice (const_iterator pos, llist &other, const_iterator other_begin, const_iterator other_end) noexcept -> void |
Splice elements from list. More... | |
Static Public Member Functions | |
static auto | iterator_to (T &elem) noexcept -> iterator |
Create iterator to element. More... | |
static auto | iterator_to (const T &elem) noexcept -> const_iterator |
Create iterator to element. More... | |
Intrusive linked list.
T | The element type of the linked list. |
Tag | A tag used to identify the link of the linked list. |
|
inline |
Range constructor.
Elements in supplied range will be linked by reference.
b,e | Iterator pair describing a range of elements to insert to the list. |
|
inlinenoexcept |
Destructor.
Unlinks all elements.
|
inline |
Reference to last item in this list.
Undefined behaviour if this list is empty.
|
inline |
Reference to last item in this list.
Undefined behaviour if this list is empty.
|
inlinenoexcept |
Test if this list is empty.
auto cycle_ptr::detail::llist< T, Tag >::erase | ( | const_iterator | b | ) | -> iterator |
Erase element from the list.
b
. auto cycle_ptr::detail::llist< T, Tag >::erase | ( | const_iterator | b, |
const_iterator | e | ||
) | -> iterator |
Erase elements from the list.
b,e | Range of elements to erase. |
b
(same as e
).
|
inline |
Reference to first item in this list.
Undefined behaviour if this list is empty.
|
inline |
Reference to first item in this list.
Undefined behaviour if this list is empty.
|
noexcept |
Link element into the list.
pos | Iterator to position in front of which the element will be inserted. |
v | The element to insert. |
v
. auto cycle_ptr::detail::llist< T, Tag >::insert | ( | const_iterator | pos, |
Iter | b, | ||
Iter | e | ||
) | -> iterator |
Link multiple elements into the list.
pos | Iterator to position in front of which the element will be inserted. |
b,e | Range of elements to link into the list. |
b
, e
). Or pos
if the range is empty.
|
inlinestaticnoexcept |
Create iterator to element.
Undefined behaviour if the element is not linked.
elem | An element that is on the list. |
|
inlinestaticnoexcept |
Create iterator to element.
Undefined behaviour if the element is not linked.
elem | An element that is on the list. |
|
inline |
Unlink the last element in the list.
Undefined behaviour if this list is empty.
|
inline |
Unlink the first element in the list.
Undefined behaviour if this list is empty.
|
inlinenoexcept |
Link element into the list, as the last item.
|
inlinenoexcept |
Link element into the list, as the first item.
|
inlinenoexcept |
Compute the size of the list.
|
noexcept |
Splice elements from list.
All elements in other
are moved into this list, before pos
.
pos | Position before which the elements are inserted. |
other | The list from which to move elements. |
|
noexcept |
Splice elements from list.
elem
in other
is moved into this list, before pos
.
pos | Position before which the elements are inserted. |
other | The list from which to move elements. |
elem | Iterator to the element that is to be moved. |
elem
is a dereferenceable iterator in other
.
|
noexcept |
Splice elements from list.
elem
in other
is moved into this list, before pos
.
pos | Position before which the elements are inserted. |
other | The list from which to move elements. |
other_begin,other_end | Range of elements to move into this list. |
other_begin
, other_end
) is a dereferenceable range in other
.