[Vala] How to check what a Gee.List contains



Is there a means to figure out what kinds of variables a Gee.List stores?

The following doesn't work because if I call mystery_list.get(0), I get
the compiler error: has no member named ‘g_destroy_func’.

using Gee;

public bool perform (Gee.List mystery_list) {
    if (! mystery_list.is_empty) {
        Value val = mystery_list.get (0);
        if (val.type().is_value_type) {
            // something something
        }
    }
}

If I cast mystery_list to Gee.List <Object>, my problem is solved (because
now a destructor is available), but then that means that mystery list
can only contain items descended from GObject.







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]