#include <string>
#include <stdio.h>
#include <stdarg.h>
std::string& std_string_format(std::string & _str, const char * _Format, ...)
{
std::string tmp;
va_list marker;
va_list backup;
va_start(marker, _Format);
va_copy(backup,marker);
size_t num_of_chars = vsnprintf(0, 0, _Format, backup);
if (num_of_chars >= tmp.capacity()) {
tmp.resize(num_of_chars + 1);
}
vsnprintf((char *)tmp.data(), tmp.capacity(), _Format, marker);
va_end(marker);
va_end(backup);
_str = tmp.c_str();
return _str;
}