On Monday, 7 November 2016 at 16:33:30 UTC, Adam D. Ruppe wrote:
On Monday, 7 November 2016 at 16:22:17 UTC, Heisenberg wrote:
Why? How can a delegate which returns nothing be used as an array which is going to be printed on the screen?

You pass the string to the delegate, which does whatever with it somewhere else.

So you call: `passed_delegate("your string");` and it can forward it to writeln or whatever.

But how does it forward it if it's:

void delegate(const(char)[]) sink // ?

It returns nothing, and just takes an array of characters as a parameter.. Just how does it print?..

Reply via email to