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

Jonathan M Davis jmdavisProg at gmx.com
Sun Sep 25 21:47:57 PDT 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


More information about the Digitalmars-d-learn mailing list