How is the return type here being deduced? In other words, how based on the return type of the function pointer does it instantiate the correct function.
template<typename From, typename To>
To Convert(const From& f)
{
std::cout << sizeof(From) << " " << sizeof(To) << std::endl;
return To(f);
}
int main()
{
float (*p)(const double &e) = Convert;
p(20.2);
}
This prints
8 4