From 35a3c7c9da9eb2bb9592fd3debe83bea1e9668f8 Mon Sep 17 00:00:00 2001 From: neargye Date: Fri, 5 Aug 2022 15:36:37 +0400 Subject: [PATCH] std::size_t -> std::uint16_t --- include/magic_enum.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 6bf1093..e861a64 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -196,22 +196,22 @@ struct range_max : std::integral_constant {}; template struct range_max::max)>> : std::integral_constant::max), customize::enum_range::max> {}; -template +template class static_string { public: - constexpr explicit static_string(string_view str) noexcept : static_string{str, std::make_index_sequence{}} { + constexpr explicit static_string(string_view str) noexcept : static_string{str, std::make_integer_sequence{}} { assert(str.size() == N); } constexpr const char* data() const noexcept { return chars_; } - constexpr std::size_t size() const noexcept { return N; } + constexpr std::uint16_t size() const noexcept { return N; } constexpr operator string_view() const noexcept { return {data(), size()}; } private: - template - constexpr static_string(string_view str, std::index_sequence) noexcept : chars_{str[I]..., '\0'} {} + template + constexpr static_string(string_view str, std::integer_sequence) noexcept : chars_{str[I]..., '\0'} {} char chars_[N + 1]; }; @@ -225,7 +225,7 @@ class static_string<0> { constexpr const char* data() const noexcept { return nullptr; } - constexpr std::size_t size() const noexcept { return 0; } + constexpr std::uint16_t size() const noexcept { return 0; } constexpr operator string_view() const noexcept { return {}; } };