List


Object Hierarchy:

GLib.List GLib.List GLib.List

Description:

[ Compact ]
[ CCode ( dup_function = "g_list_copy" , free_function = "g_list_free" ) ]
public class List<G>

The List struct is used for each element in a doubly-linked list.

Example: Apply a function to each element:

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

// Output:
// ``1. entry``
// ``2. entry``
// ``3. entry``

list.foreach ((entry) => {
print (@"$entry\n");
});

return 0;
}

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


Namespace: GLib
Package: glib-2.0

Content:

Creation methods:

Methods:

Fields: