index


Description:

[ Version ( since = "2.4" ) ]
public int index (G data)

Returns the position of the first element in this which contains data.

Example: Get the index of data:

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

// Output: ``1``
uint pos = queue.index (2);
print ("%u\n", pos);

return 0;
}

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

Parameters:

this

a Queue

data

the data to find

Returns:

the position of the first element in this which contains data, or -1 if no element in this contains data