Qore Programming Language Reference Manual  0.8.12.3
Overloading

Functions and methods can be overloaded if parameter types are declared as in the following example:

1 int sub example(int i) {
2  printf("i=%d\n", i);
3  return i + 1;
4 }
5 
6 string sub example(string str) {
7  printf("str=%s\n", str);
8  return str + "foo";
9 }

In this case, the first version (example(int)) will be executed if called with an integer argument, and the second (example(string)) if called with a string argument.

Class methods may also be overloaded, but note that destructor(), copy(), methodGate(), memberGate(), and memberNotification() methods may not be overloaded (see Classes for more information).