![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
Intrusive single linked list with optional ownership. More...
Go to the source code of this file.
Intrusive single linked list with optional ownership.
This helper template allows to attach a number of tightly integrated elements with low overhead. Typically, these elements are to be attached once and never changed. Optionally, elements can be created using a custom allocation scheme; the holder might also take ownership. These variations in functionality are controlled by policy templates.
The rationale for using this approach is
next. Consequently, each such node element can not be member in several collections at the same time (unless they share all elements) Definition in file linked-elements.hpp.
#include "lib/error.hpp"#include "lib/nocopy.hpp"#include "lib/iter-adapter.hpp"#include "lib/allocator-handle.hpp"#include "lib/util.hpp"#include <utility>#include <memory>Namespaces | |
| namespace | lib |
| Implementation namespace for support and library code. | |
| namespace | lib::linked_elements |
Typedefs | |
| template<class N > | |
| using | OwningHeapAllocated = OwningAllocated< std::allocator< N > > |
| default policy: use standard heap allocation for new elements | |
Classes | |
| struct | OwningAllocated< ALO > |
| < allocation policies for the LinkedElements list container More... | |
| struct | NoOwnership |
| Policy for LinkedElements: never create or destroy any elements, only allow to add already existing nodes. More... | |
| class | LinkedElements< N, ALO > |
| Intrusive single linked list, possibly taking ownership of node elements. More... | |
| struct | LinkedElements< N, ALO >::IterationState |
| Iteration is just following the single linked list. More... | |
Functions | |
| template<class N > | |
| auto & | asLinkedElements (N *const &anchor) |
| transiently reinterpret an element pointer as const LinkedElements, allowing to count, iterate or subscript a chain of elements | |