function overload on full signature?

Peter Alexander peter.alexander.au at gmail.com
Tue Nov 13 13:37:37 PST 2012


On Tuesday, 13 November 2012 at 21:34:28 UTC, Rob T wrote:
> I'm wondering why overloading has been implemented to only 
> match on the argument list rather than the full signature which 
> includes the return type? I know I would use it if it was 
> available.

If it worked on return type, how would it decide the overload?

int foo() { ... }
string foo() { ... }

void bar(int x) { ... }
void bar(string y) { ... }

auto z = foo(); // what foo?
bar(foo()); // what foo?


More information about the Digitalmars-d mailing list