clear


Description:

[ Version ( since = "2.14" ) ]
public void clear ()

Removes all the elements in this.

If queue elements contain dynamically-allocated memory, they should be freed first.

Example: Clear:

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

// Output: ``3``
print ("%u\n", queue.get_length ());

// Output: ``0``
queue.clear ();
print ("%u\n", queue.get_length ());

return 0;
}

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

Parameters:

this

a Queue