Can't understand the application of delegates in toString() functions

Heisenberg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 7 08:53:12 PST 2016


On Monday, 7 November 2016 at 16:37:50 UTC, Mathias Lang wrote:
> On Monday, 7 November 2016 at 16:22:17 UTC, Heisenberg wrote:
>> [...]
>
> When you ask for a string (or more generally, an array), you 
> put a specific construct on the way the data should be. For 
> starters, the items have to be contiguous in memory. But most 
> of the time, they aren't, and you end up allocating memory to 
> put them contiguously.
>
> [...]

I see.. So we're basically adding stuff to it and then printing 
it all in one go. Still, the delegate in the example isn't 
defined, so how does it manage to output the result?


More information about the Digitalmars-d-learn mailing list