Intrusive queue container example
#include <iostream>
{
int value;
explicit MyQueueNode(int v) : value(v) {}
};
int main(int argc, char** argv)
{
MyQueueNode item1(123);
MyQueueNode item2(456);
MyQueueNode item3(789);
while (queue)
std::cout <<
"queue.pop() = " << queue.
pop()->value << std::endl;
return 0;
}
Intrusive queue container.
T * pop() noexcept
Pop the item from the front of the queue.
void push(T &item) noexcept
Push a new item into the back of the queue.
Intrusive queue container definition.