+ 2
In which cases should you use function template and function overloading
3 odpowiedzi
+ 1
You would use function overloading when you cant be sure of the arguments that may be passed to that function, so you would have one function copied multiples times with the same signature but with diffrenet parameters to cover all possible inputs.
+ 1
if we need to perform identical operations on two or more types of data, we use function overloading to create two function with the required function declaration. However, a better approach would be to use function templates