pop_head


Description:

public G pop_head ()

Removes the first element of the queue and returns its data.

Example: Pop head:

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

// Output: ``1 2 3 ``
string item = null;
while ((item = queue.pop_head ()) != null) {
print ("%s ", item);
}
print ("\n");

return 0;
}

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

Parameters:

this

a Queue

Returns:

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