Commit ae1ed348 authored by Alexander Lapshin's avatar Alexander Lapshin

.

parent 0d38cca0
......@@ -60,20 +60,20 @@ static std::string ToStr(const int arg)
// return "";
// }
static std::string ToStr(const long long arg)
{
std::array<char, 32> buf;
const auto res = std::to_chars(buf.data(), buf.data() + buf.size(), arg);
if (res.ec == std::errc()) {
return std::string(buf.data(), res.ptr - buf.data());
}
hangle_to_chars_error(res, arg);
return "";
}
// static std::string ToStr(const long long arg)
// {
// std::array<char, 32> buf;
//
// const auto res = std::to_chars(buf.data(), buf.data() + buf.size(), arg);
//
// if (res.ec == std::errc()) {
// return std::string(buf.data(), res.ptr - buf.data());
// }
//
// hangle_to_chars_error(res, arg);
//
// return "";
// }
static std::string ToStr(const bool arg)
{
......@@ -98,10 +98,17 @@ static std::string ToStr(const int arg, const int leading_zeros)
ss << std::setw(leading_zeros) << std::setfill('0');
ss << arg;
return ss.str();
}else {
}
else {
return ToStr(arg);
}
}
static std::string ToStr(const long long arg)
{
std::ostringstream ss;
ss << arg;
return ss.str();
}
// static std::string ToStr(const size_t arg, const int leading_zeros)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment