[phobos] std.string.format

Martin Nowak dawg at dawgfoto.de
Sun Mar 25 16:31:47 PDT 2012


I'm a little tired of repeating this code snippets over and over again.

string formatString(Args...)(string fmt, auto ref Args args)
{
     import std.array, std.format;
     auto app = appender!string();
     formattedWrite(app, fmt, args);
     return app.data;
}

What's the reason that std.string.format defaults to vararg formatting?


More information about the phobos mailing list