Re: [Vala] overload functions



Martin (OpenGeoMap) schrieb:
Hi all:

Is there any trick to overload functions in Vala?.

No, because the API should be usable in C, too. Just use slightly different method names. And you can use default values for parameters:

void method (int param1 = 5, string param2 = "x", bool param3 = false) {
        ...
}


then you can call

method ();
method (6);
method (6, "y");
method (6, "y", true);


Regards,

Frederik



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