I want to write a generic function where I can specify the return type like float, double... but get the following errors.
I am using VS 2017 CE
E0304 no instance of function template "average" matches the argument list
Generic_Algorithms_CPP Generic_Algorithms_CPP\Generic_Algorithms_CPP.cpp 25
Error C2672 'average': no matching overloaded function found
Generic_Algorithms_CPP generic_algorithms_cpp.cpp 25
Error C2783 'ReturnType average(Iter,Iter)': could not deduce template argument for
'ReturnType' Generic_Algorithms_CPP generic_algorithms_cpp.cpp 25