mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-07 17:41:11 +00:00
Use write instead of format_int in to_string
This commit is contained in:
parent
98dcc251eb
commit
e956a14e9e
@ -3380,7 +3380,10 @@ inline std::string to_string(const T& value) {
|
|||||||
}
|
}
|
||||||
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
|
template <typename T, FMT_ENABLE_IF(std::is_integral<T>::value)>
|
||||||
inline std::string to_string(T value) {
|
inline std::string to_string(T value) {
|
||||||
return format_int(value).str();
|
char buffer[detail::digits10<T>() + 2];
|
||||||
|
char* begin = buffer;
|
||||||
|
char* end = detail::write<char>(begin, value);
|
||||||
|
return std::string(begin, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user