Phobos for Review: std.buffer.scopebuffer

Jakob Ovrum jakobovrum at gmail.com
Fri Feb 7 14:15:11 PST 2014


On Friday, 7 February 2014 at 21:24:16 UTC, Brad Anderson wrote:
> On Friday, 7 February 2014 at 21:05:43 UTC, Jerry wrote:
>> I'd suggest reversing the arguments:
>>
>>  void buildPath(IR, OR)(OR result, IR segments)
>>      if (isInputRange!IR && isOutputRange!(OR, char));
>>
>> That way you can use it as:
>>
>> buffer.buildPath(p1, p2, ...);
>>
>> It at least opens up chaining possibilities.
>
> On the other hand the output buffer last allows stuff like this 
> contrived example:
>
> "some/foo/path"
>   .splitter("/")
>   .buildPath(buffer);
>
> I'm not sure what would be more common and useful.

Those are two different overloads, so I think we could do both.


More information about the Digitalmars-d mailing list