[Vala] how to pass a List by reference?




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?

-- 
Regards,
Brian Winfrey




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