Re: Efficient outputting of to-string conversions

2011-02-08 Thread spir
On 02/07/2011 11:38 PM, Tomek Sowiński wrote: Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there

Re: Efficient outputting of to-string conversions

2011-02-08 Thread Jonathan M Davis
On Tuesday 08 February 2011 07:55:23 spir wrote: On 02/07/2011 11:38 PM, Tomek Sowiński wrote: Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately

Re: Efficient outputting of to-string conversions

2011-02-08 Thread Steven Schveighoffer
On Tue, 08 Feb 2011 10:55:23 -0500, spir denis.s...@gmail.com wrote: On 02/07/2011 11:38 PM, Tomek Sowiński wrote: Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned

Re: Efficient outputting of to-string conversions

2011-02-08 Thread Steven Schveighoffer
On Tue, 08 Feb 2011 11:09:44 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Tue, 08 Feb 2011 10:55:23 -0500, spir denis.s...@gmail.com wrote: On 02/07/2011 11:38 PM, Tomek Sowiński wrote: Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks

Re: Efficient outputting of to-string conversions

2011-02-08 Thread Tomek Sowiński
Andrei Alexandrescu napisał: I know about Steven's proposal but it applies only to user types not primitives. Either way std.conv.to would need a buffered output range as integers are written from the right. Any chance for an abstraction analogous to buffered input ranges discussed

Re: Efficient outputting of to-string conversions

2011-02-08 Thread Tomek Sowiński
Andrei Alexandrescu napisał: For the latter, Tomek's idea of passing an output range as an optional second parameter seems appropriate. Please file as an enhancement to bugzilla. If anyone has time to work on this, please do. If not, I'll work on it as my schedule allows.

Efficient outputting of to-string conversions

2011-02-07 Thread Tomek Sowiński
Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans to include a custom output variant, e.g. to!string(7, outputRange)? -- Tomek

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Jonathan M Davis
On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans to include a custom output variant, e.g. to!string(7, outputRange)?

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Tomek Sowiński
Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans to include a custom output variant,

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 4:43 PM, Jonathan M Davis wrote: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans to include a custom output

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 5:38 PM, Tomek Sowiński wrote: Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed and discarded in my XML writer. Are there plans

Re: Efficient outputting of to-string conversions

2011-02-07 Thread Andrei Alexandrescu
On 2/7/11 7:25 PM, Andrei Alexandrescu wrote: On 2/7/11 5:38 PM, Tomek Sowiński wrote: Jonathan M Davis napisał: On Monday 07 February 2011 13:10:09 Tomek Sowiński wrote: Looks like std.conv.to always allocates behind the scenes. It's a shame as the returned string is immediately processed