Thread overview
Re: Why is std.string.format a c-style variadic function?
Sep 26, 2011
Jonathan M Davis
Sep 26, 2011
Jacob Carlborg
Sep 26, 2011
Andrej Mitrovic
September 26, 2011
On Monday, September 26, 2011 05:39:16 Andrej Mitrovic wrote:
> I'm only asking because I can't use it inside of a pragma(msg) call
> since CTFE can't do C-style variadic functions yet. Is `format`
> defined this way for performance reasons? (to avoid template bloat?)

Use std.metastrings.Format.

As for std.string.format, I believe that Kenji Hara has been working on improving it. I suspect that it is the way that it is, because it was probably a function in D1, and D1 probably doesn't have variadic templates (I don't use D1 though, so I don't know for sure).

- Jonathan M Davis
September 26, 2011
On 2011-09-26 06:47, Jonathan M Davis wrote:
> On Monday, September 26, 2011 05:39:16 Andrej Mitrovic wrote:
>> I'm only asking because I can't use it inside of a pragma(msg) call
>> since CTFE can't do C-style variadic functions yet. Is `format`
>> defined this way for performance reasons? (to avoid template bloat?)
>
> Use std.metastrings.Format.
>
> As for std.string.format, I believe that Kenji Hara has been working on
> improving it. I suspect that it is the way that it is, because it was probably
> a function in D1, and D1 probably doesn't have variadic templates (I don't use
> D1 though, so I don't know for sure).
>
> - Jonathan M Davis

D1 do have variadic templates.

-- 
/Jacob Carlborg
September 26, 2011
On 9/26/11, Jonathan M Davis <jmdavisProg@gmx.com> wrote:
> Use std.metastrings.Format.

Sweet, I forgot about this one. Thanks.