peek_head


Description:

public unowned G peek_head ()

Returns the first element of the queue.

Example: Peek head:

public static int main () {
Queue<int> queue = new Queue<int> ();
queue.push_tail (1);
queue.push_tail (2);
queue.push_tail (3);

// Output: ``peek: 1; size: 3``
int i = queue.peek_head ();
print ("peek: %d; size: %u\n", i, queue.get_length ());

return 0;
}

valac --pkg glib-2.0 GLib.Queue.peek_head.vala

Parameters:

this

a Queue

Returns:

the data of the first element in the queue, or null if the queue is empty