21.06.2011 11:05, Serge Hulne пишет:
> You will notice that in the second case (the naive straightforward
> formulation) the data is duplicated (passed by value in the
> assignment) whereas in the first case (which uses a class wrapper) the
> object a is assigned to b by reference (not by value, i.e. the data is
> not duplicated)

'string' is a kind of primitive in Vala, it's designed to be passed by
value. Just like int, double, etc. in C. If you want not to duplicate a
string, use 'unowned' keyword, like:

    string a = "hello";
    unowned string b = a;

-- 
Best regards, Gavrilov Maksim.
_______________________________________________
vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to