Ejemplo n.º 1
0
 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;
   }
 }
Ejemplo n.º 2
0
 /// 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());
 }
Ejemplo n.º 3
0
 /**
  * @warning call only from the reader (owner)
  */
 pointer try_pop() {
     return take_head();
 }