Using arrays with functions taking ranges

monarch_dodra monarchdodra at gmail.com
Fri Dec 14 08:49:19 PST 2012


On Friday, 14 December 2012 at 15:59:48 UTC, Mu wrote:
>> It works because "put" is defined for all input ranges as 
>> "write to first element and popFront".
>
> That makes more sense, thanks.
> So what happens is that for "regular" ranges std.range.put() 
> gets used, while for arrays in RefAppender std.array.put() gets 
> used, right?

Nope, you call the member function. std.array.RefAppender.put.

Link to how "put" resolves. 
http://dlang.org/phobos/std_range.html#put


More information about the Digitalmars-d-learn mailing list