Tutorial by Topics: overloading

See also separate topic on Overload Resolution Ambiguities can occur when one type can be implicitly converted into more than one type and there is no matching function for that specific type. For example: void foo(double, double); void foo(long, long); //Call foo with 2 ints foo(1, 2);...
In C++, it is possible to define operators such as + and -> for user-defined types. For example, the <string> header defines a + operator to concatenate strings. This is done by defining an operator function using the operator keyword. The operators for built-in types cannot be change...
A normal function is never related to a function template, despite same name, same type. A normal function call and a generated function template call are different even if they share the same name, same return type and same argument list
Most operators in Rust can be defined ("overloaded") for user-defined types. This can be achieved by implementing the respective trait in std::ops module.

Page 1 of 1