void test_glist () {
var list = new GLib.List<string> ();
+ assert (list.is_empty ());
list.prepend ("foo");
list.prepend ("bar");
+ assert (!list.is_empty ());
assert (list.nth_data (1) == "foo");
list = null;
void test_gslist () {
var list = new GLib.SList<string> ();
+ assert (list.is_empty ());
list.prepend ("foo");
list.prepend ("bar");
+ assert (!list.is_empty ());
assert (list.nth_data (1) == "foo");
list = null;
void test_gqueue () {
var queue = new GLib.Queue<string> ();
+ assert (queue.is_empty ());
queue.push_head ("foo");
queue.push_head ("bar");
+ assert (!queue.is_empty ());
assert (queue.peek_nth (1) == "foo");
queue = null;
public int position (List<G> llink);
public int index (G data);
+ [CCode (cname = "vala_g_list_is_empty")]
+ public inline bool is_empty () {
+ return (List?) this == null;
+ }
+
public G data;
public List<G> next;
public unowned List<G> prev;
public int position (SList<G> llink);
public int index (G data);
+ [CCode (cname = "vala_g_slist_is_empty")]
+ public inline bool is_empty () {
+ return (SList?) this == null;
+ }
+
public G data;
public SList<G> next;
}