put string[] into a appender without loop?

AsmMan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Sep 21 17:37:11 PDT 2014


On Monday, 22 September 2014 at 00:30:44 UTC, Vladimir Panteleev 
wrote:
> On Monday, 22 September 2014 at 00:18:03 UTC, AsmMan wrote:
>> this give undefined identifier: 'put' error. (std.array is 
>> already included, buffer.put(string) doesn't give same error)
>
> You need to import std.range.

Thanks, I was thinking std.array is enough

>> The copy of an array doesn't happen often as string but do 
>> suggest to I want something else instead of appender?
>
> No, I was just thinking aloud about how Appender could be 
> improved in the future.
>
> To minimize allocations right now, you could write your own 
> put-like function which calls Appender.reserve.

this is not critical (for now, I'm not doing any optmization) but 
I'll save the idea.


More information about the Digitalmars-d-learn mailing list