About string and int spliced together.

Steven Schveighoffer schveiguy at gmail.com
Thu Jun 18 14:24:40 UTC 2020


On 6/18/20 10:04 AM, Stanislav Blinov wrote:
> On Thursday, 18 June 2020 at 13:59:42 UTC, Steven Schveighoffer wrote:
> 
>> age.to!string will allocate a temporary string just to throw it away. 
>> text will not do that.
>>
>> -Steve
> 
> Wouldn't it?
> 
> https://github.com/dlang/phobos/blob/master/std/conv.d#L4193

Yikes. Let me rephrase.

text is perfectly capable of avoiding this, and should, but for some 
reason doesn't.

For sure format does not do this.

(checks... yeah, it avoids that, but the code is a mess comparatively)

-Steve


More information about the Digitalmars-d mailing list