index


Description:

public int index (G data)

Example: Get the link-position containing the given data:

public static int main (string[] args) {
SList<int> list = new SList<int> ();
list.append (1);
list.append (2);
list.append (3);

// Output: ``valid index: 2``
int i = list.index (3);
print ("valid index: %d\n", i);

// Output: ``valid index: -1``
i = list.index (4);
print ("valid index: %d\n", i);

return 0;
}

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