On 10/13/11 11:02 PM, "bsquared" <[email protected]> wrote:
>
> I am guessing that I'm going about this wrong, but I want to populate a list
> from a static method.
>
> static void populate_list (ref SList<string> list) {
> list.append("");
> }
>
> I am getting a compiler error:
> error: Cannot capture reference or output parameter
>
> I want the ownership of the list to belong to the calling method.
>
> What am I doing wrong?
You could use out instead to populate the list:
static void populate_list (out Slist<string> list) {
}
And call this method with:
var list = new Slist<string> ();
populate_list (out list);
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list