Intrusive list container example
#include <iostream>
{
int value;
MyListNode(int v) : value(v) {}
};
int main(int argc, char** argv)
{
MyListNode item1(123);
MyListNode item2(456);
MyListNode item3(789);
while (list)
std::cout <<
"list.pop_front() = " << list.
pop_front()->value << std::endl;
return 0;
}
Intrusive list container.
void push_next(T &base, T &item) noexcept
Push a new item as a next to the given one.
void push_back(T &item) noexcept
Push a new item into the back of the list.
T * pop_front() noexcept
Pop the item from the front of the list.
void push_front(T &item) noexcept
Push a new item into the front of the list.
Intrusive list container definition.