peek_nth


Description:

[ Version ( since = "2.4" ) ]
public unowned G peek_nth (uint n)

Returns the n'th element of this.

Example: Peek nth:

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

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

return 0;
}

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

Parameters:

this

a Queue

n

the position of the element

Returns:

the data for the n'th element of this, or null if n is off the end of this