#include "StdAfx.h" //#include #include "Strings.h" #include //#include #include String format(const String& format, ...) { String s; size_t size = 256; // arbitrary buffer size va_list argList; do { std::vector buf(size); va_start(argList, format); int n = _vsntprintf_s(buf.data(), size, _TRUNCATE, format.c_str(), argList); va_end(argList); if (n < 0) { size *= 2; continue; } s = buf.data(); } while (false); return s; }