Hello,

2011/10/13 bsquared <bwcod...@gmail.com>:
>
> 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

The above compiles without problems for me (valac 0.14.0). This error
probably means that you are trying to use this variable from a lambda
expression.

Another solution is to use libgee: libgee's lists are objects and
don't need any special treatment (just pass them normally and you can
call list.add with no problems)

HTH,
Abderrahim
_______________________________________________
vala-list mailing list
vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to