diff options
author | crupest <crupest@outlook.com> | 2021-04-01 21:33:24 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-04-01 21:33:24 +0800 |
commit | 7874ec6bb127e87020a05154cd2f3105386e9109 (patch) | |
tree | 0ed3e8b0d771c274439976c7c02c7f8c7c7c6d0a /include/cru/common/Format.hpp | |
parent | af2e38b320905bf3b1e5d0969d0811c47289bbfe (diff) | |
parent | ba43736c55ad510942e9e83ca0c8bea7265cf055 (diff) | |
download | cru-7874ec6bb127e87020a05154cd2f3105386e9109.tar.gz cru-7874ec6bb127e87020a05154cd2f3105386e9109.tar.bz2 cru-7874ec6bb127e87020a05154cd2f3105386e9109.zip |
Merge branch 'master' of https://github.com/crupest/CruUI
Diffstat (limited to 'include/cru/common/Format.hpp')
-rw-r--r-- | include/cru/common/Format.hpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/include/cru/common/Format.hpp b/include/cru/common/Format.hpp index 59f34036..d4da2208 100644 --- a/include/cru/common/Format.hpp +++ b/include/cru/common/Format.hpp @@ -13,11 +13,6 @@ namespace cru { template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>> std::u16string ToUtf16String(T number) { - std::array<char, 40> buffer; - auto result = - std::to_chars(buffer.data(), buffer.data() + buffer.size(), number); - Ensures(result.ec == std::errc()); - std::string_view utf8_result(buffer.data(), result.ptr - buffer.data()); - return ToUtf16(utf8_result); + return ToUtf16(std::to_string(number)); } } // namespace cru |