Co do funkcji kompilator widzi różne funkcję.
#include <iostream>
// Volume of a cube.
int Volume(int s) {
return s * s * s;
}
// Volume of a cylinder.
double Volume(double r, int h) {
return 3.1415926 * r * r * static_cast<double>(h);
}
// Volume of a cuboid.
long Volume(long l, int b, int h) {
return l * b * h;
}
int main() {
std::cout << Volume(10);
std::cout << Volume(2.5, 8);
std::cout << Volume(100l, 75, 15);
}
https://en.wikipedia.org/wiki/Function_overloading
W tym przypadku 3 różne. Więc nie masz utraty wydajności przez przeciążenie. Możesz pocztać o Name mangling, albo po Polsku jest to chyba ozdabianie nazw.
Tutaj po prostu skopiuje wpis z Stacka(https://stackoverflow.com/questions/4421706/what-are-the-basic-rules-and-idioms-for-operator-overloading). Ogólnie operatory narzucają jakiś koszt, tak bardzo ogólnie.