Lines Matching refs:element
42 // The element type must support copy constructor.
43 template <typename E> // E is the element type
46 // QueueNode is a node in a Queue, which consists of an element of
48 template <typename E> // E is the element type
53 // Gets the element in this node.
54 const E& element() const { return element_; }
61 // Creates a node with a given element value. The next pointer is
73 template <typename E> // E is the element type.
104 // Gets the first element of the queue, or NULL if the queue is empty.
108 // Gets the last element of the queue, or NULL if the queue is empty.
112 // Adds an element to the end of the queue. A copy of the element is
114 // Changes made to the element in the queue doesn't affect the source
116 void Enqueue(const E& element) {
117 QueueNode<E>* new_node = new QueueNode<E>(element);
143 E* element = new E(old_head->element());
146 return element;
149 // Applies a function/functor on each element of the queue, and
156 new_queue->Enqueue(function(node->element()));