Lines Matching refs:element
39 // The element type must support copy constructor.
40 template <typename E> // E is the element type
43 // QueueNode is a node in a Queue, which consists of an element of
45 template <typename E> // E is the element type
50 // Gets the element in this node.
51 const E& element() const { return element_; }
58 // Creates a node with a given element value. The next pointer is
71 template <typename E> // E is the element type.
102 // Gets the first element of the queue, or NULL if the queue is empty.
106 // Gets the last element of the queue, or NULL if the queue is empty.
110 // Adds an element to the end of the queue. A copy of the element is
112 // Changes made to the element in the queue doesn't affect the source
114 void Enqueue(const E& element) {
115 QueueNode<E>* new_node = new QueueNode<E>(element);
141 E* element = new E(old_head->element());
144 return element;
147 // Applies a function/functor on each element of the queue, and
155 new_queue->Enqueue(function(node->element()));