void close(F& f) noexcept(noexcept(f(std::declval<pointer>()))) { node_pointer ptr = take_head(stack_closed_tag()); while (ptr != nullptr) { auto next = ptr->next; f(promote(ptr)); ptr = next; } }
/// Sets the head to `stack_empty_tag()` and returns the previous head if /// the queue was not empty. pointer take_head() noexcept { return take_head(stack_empty_tag()); }
/** * @warning call only from the reader (owner) */ pointer try_pop() { return take_head(); }