Hi! I've been experimenting with D functions, and found this
piece of code:
//
int abc(int delegate(long i));
int def(int function(long s));
void test() {
int b = 3;
abc( (long c) { return 6 + b; } ); // inferred to delegate
def( (long c) { return c * 2; } ); // inferred to function
}
On Wednesday, 16 July 2014 at 15:12:58 UTC, Pavel wrote:
Hi! I've been experimenting with D functions, and found this
piece of code:
//
int abc(int delegate(long i));
int def(int function(long s));
void test() {
int b = 3;
abc( (long c) { return 6 + b; } ); // inferred to delegate
def(
I would just change all the longs to ints and it would probably
work. Or all the longs to ints.
It really should have been consistent in the docs, since the
point of this is delegate vs function, not int vs long...
On Wednesday, 16 July 2014 at 15:44:03 UTC, Adam D. Ruppe wrote:
I would just change all the longs to ints and it would probably
work. Or all the longs to ints.
It really should have been consistent in the docs, since the
point of this is delegate vs function, not int vs long...