I have the following questions regarding function overloading in C++
1. Why is that the C++ compiler cannot distinguish between two functions when it has the same name and parameter list but different return type? Why can't name mangling take even the return type in to account so that the mangled names of functions with same names and parameter list but different return types, can be differnet.
2. Why does the C++ compiler considers the following two functions as redeclaration
void f(const int) //considered as redeclaration of above
while the following functions are considered as overloaded
voif f (const int*) //overloads the function declared above
Thanks in advance.