Eigenpoll : D wish list : Return-type overloading
Return-type overloading is the ability to overload a function based on return type. Examples:
int foo();
short foo();
byte foo();
real foo();
In order to call this, the cases of glaring ambiguity must be resolved with a special call syntax which specifies which overload to call. Examples (referencing above examples):
int main(char[][] args) {
int a;
a = foo(); // error: ambiguous
a = call(int)foo(); // calls int-returning overload
}
Report this item for cleanup