summaryrefslogtreecommitdiff
path: root/src/KingSystem/Utils/FixedString.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/KingSystem/Utils/FixedString.h')
-rw-r--r--src/KingSystem/Utils/FixedString.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/KingSystem/Utils/FixedString.h b/src/KingSystem/Utils/FixedString.h
index 039df272..1119ac0b 100644
--- a/src/KingSystem/Utils/FixedString.h
+++ b/src/KingSystem/Utils/FixedString.h
@@ -56,13 +56,14 @@ template <auto N, int base = 10>
constexpr auto Str() {
constexpr char digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
- FixedString<([]() constexpr noexcept {
+ constexpr auto len = [] {
unsigned int len = N > 0 ? 0 : 1;
for (auto n = N; n; len++, n /= base)
continue;
return len;
- }())>
- buf{};
+ }();
+
+ FixedString<len> buf{};
auto ptr = buf.data() + buf.length();
if (N == 0) {