M
Madhav
Hi All,
Very recently I had one iteresting question about
overloading. The guy was arguing why we dont have overloading based on
return type. I told him about the reason mentioned in "Thinking in C+
+", which is what if the return type is ignored by the caller.
He then said that the regular overloading places
restrictions - such as same fucntion names, different type or number
of arguments. If the language creators wanted to implement
overloading, they could have forced the restriction of specifiying the
return type each time the caller ignores that function.
I request everyone to comment on this. I really want to find
out why overloading is not supported on the basis of return type of
the function.
Regards,
Madhav.
Very recently I had one iteresting question about
overloading. The guy was arguing why we dont have overloading based on
return type. I told him about the reason mentioned in "Thinking in C+
+", which is what if the return type is ignored by the caller.
He then said that the regular overloading places
restrictions - such as same fucntion names, different type or number
of arguments. If the language creators wanted to implement
overloading, they could have forced the restriction of specifiying the
return type each time the caller ignores that function.
I request everyone to comment on this. I really want to find
out why overloading is not supported on the basis of return type of
the function.
Regards,
Madhav.