Type inference and overloaded functions

bearophile bearophileHUGS at lycos.com
Tue Dec 17 09:01:54 PST 2013


Namespace:

> Done:
> https://github.com/D-Programming-Language/dmd/pull/2958

If you have a situation like this:

int[3] foo() {
     typeof(return) a;
     return a;
}
void main() {
     int[100] b;
     b[0 .. 3] = foo();
}


Can you use code like this to infer the length of the part needed 
to copy?


int[3] foo() {
     typeof(return) a;
     return a;
}
void main() {
     int[100] b;
     b[0 .. $] = foo();
}


Bye,
bearophile


More information about the Digitalmars-d-learn mailing list