Why don\'t more mainstream statically typed languages support function/method overloading by return type? I can\'t think of any that do. It seems no less useful or reasona
I think this is a GAP in modern C++ definition… why ?
int func();
double func();
// example 1. → defined
int i = func();
// example 2. → defined
double d = func();
// example 3. → NOT defined. error
void main()
{
func();
}
Why can a C++ compiler can not throw an error in example "3" and accept the code in example "1+2" ??