dev/vala/gee_list_iter/gee_list_iter.vala

16 lines
377 B
Vala

void main () {
var list = new Gee.ArrayList<string> ();
list.add ("1");
list.add ("2");
list.add ("3");
var it = list.bidir_list_iterator ();
for (var has_next = it.first (); has_next; has_next = it.next ()) {
var next = list.bidir_list_iterator ();
next = it;
next.next ();
stdout.printf ("list[%d] = %s, ", it.index (), it.get ());
}
stdout.printf ("\n");
}