
25 Nov
2009
25 Nov
'09
8:54 p.m.
Stefan Strasser wrote:
this is just an idea off the top of my head, I haven't thought this through, but has the committee ever considered making functions overloadable by their return type?
void f(); // 1 int f(); // 2
int main(){ f(); //resolves to 1 int b=f(); //resolves to 2 }
That's a pretty drastic language change to solve an issue that is really a library problem. (Besides, what if I want to call function 2 for its side effects and ignore its return type? Even the ugly "(void)f()" doesn't seem to do what I want.) --Jeffrey Bosboom