Christopher Wright wrote:
Bill Baxter wrote:
It's not?
foreach(i; things) {
if (i==a) continue;
if (i==b) break;
if (i==d) return;
if (i==c) goto somewhere;
}
Those are all fairly common things to do from inside the 'dg' call.
The int is how the compiler distinguishes which case got you out of
the dg.
--bb
You didn't read my post carefully.
The use case you would lose is:
int opApply (int delegate(something) dg)
{
auto result = dg(stuff);
if (result)
{
// This would be impossible if we took a void delegate.
log ("iteration stopped early");
return result;
}
return 0;
}
Why would you ever want to do that??