Something like
let f x = log(x)
and later I can apply f to matrix, vector or a float.
I guess it is not possible since F# is strictly static typed. Any other patters to overcome this problem?
Thanks!
Function overloading is a feature of Object Oriented programming languages like Java and C++. As we know, C is not an Object Oriented programming language. Therefore, C does not support function overloading.
You may overload a function template either by a non-template function or by another function template. The function call f(1, 2) could match the argument types of both the template function and the non-template function.
Yes since it has the same name but with a different parameter type.
As explained from the definition of Function Overloading in C++, to overload two or more functions, they must have the same function name and different parameters that are either a different number of parameters or different data types of parameters or both.
See my answer to this question:
Functions with generic parameter types
Briefly:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With