insert_sorted


Description:

[ ReturnsModifiedPointer ]
public void insert_sorted (owned G data, CompareFunc<G> compare_func)

Example: Insert, sorted:

public static int main (string[] args) {
List<string> list = new List<string> ();
list.insert_sorted ("CC", strcmp);
list.insert_sorted ("AA", strcmp);
list.insert_sorted ("BB", strcmp);

// Output:
// ``AA``
// ``BB``
// ``CC``
foreach (string str in list) {
print ("%s\n", str);
}

return 0;
}

valac --pkg glib-2.0 GLib.List.insert_sorted.vala