Use case: eliminate hidden allocations in buildPath
monarch_dodra
monarchdodra at gmail.com
Thu Dec 5 00:52:04 PST 2013
On Thursday, 5 December 2013 at 08:45:08 UTC, Jacob Carlborg
wrote:
> On 2013-12-05 09:09, monarch_dodra wrote:
>
>> Use an output range. It's the generic D approach, and what we
>> already do
>> for the string functions such as std.string.translate:
>> http://dlang.org/phobos/std_string.html#.translate
>> (look down for the output range overloads).
>>
>> Anything "allocator" related should be carried by the output
>> range
>> itself. The function itself should not care nor know about any
>> of that.
>
> In general case, what would you suggest for functions not
> operating on ranges?
How do you mean? As in functions that only output a "single item"?
More information about the Digitalmars-d
mailing list