template<typename T>
Dllink class

doubly linked node (that may also be a "head" a list)

A Doubly-linked List class. This class simply contains a link of node's. By adding a "head" node (sentinel), deleting a node is extremely fast (see "Introduction to Algorithm"). This class does not keep the length information as it is not necessary for the FM algorithm. This saves memory and run-time to update the length information. Note that this class does not own the list node. They are supplied by the caller in order to better reuse the nodes.

Doubly Linked List Structure:

    ┌─────────────────────────────────────┐
                  Head/Sentinel          
      ┌─────┐     ┌─────┐     ┌─────┐   
    └─▶│next │────▶│next │────▶│next │───┘
                                
       prev│◀────│prev│◀────│prev│◀─┐
       └─────┘     └─────┘     └─────┘ 
                                  
                                  
         └─────────┼───┼───────┼───┼───┘
                                
                ┌─────┐ ┌─────┐ ┌─────┐
                Node1 Node2 Node3
                Data  Data  Data 
                └─────┘ └─────┘ └─────┘

Each node has 'next' and 'prev' pointers, with the head/sentinel
serving as a boundary marker to simplify insertion/deletion.

Constructors, destructors, conversion operators

Dllink(T data) explicit constexpr noexcept
Construct a new Dllink object.
Dllink() defaulted constexpr
Copy construct a new Dllink object (deleted intentionally)

Public functions

auto lock() noexcept -> void -> auto constexpr
lock the node (and don't append it to any list)
auto is_locked() const noexcept -> bool -> auto constexpr
whether the node is locked
auto detach() noexcept -> void -> auto constexpr
detach from a list

Public variables

T data

Function documentation

template<typename T>
Dllink<T>::Dllink(T data) explicit constexpr noexcept

Construct a new Dllink object.

Parameters
data in the data

template<typename T>
auto Dllink<T>::is_locked() const noexcept -> bool constexpr

whether the node is locked

Returns true

Variable documentation

template<typename T>
T Dllink<T>::data

data