Why is std.string.format a c-style variadic function?

Jacob Carlborg doob at me.com
Sun Sep 25 23:27:23 PDT 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


More information about the Digitalmars-d-learn mailing list