From a8c9e57fbe1aac0c66cdc810d60308e9dbf1e357 Mon Sep 17 00:00:00 2001 From: rpatters1 Date: Tue, 25 Jan 2022 12:14:23 -0600 Subject: [PATCH] fix #122 add static_assert to limit size of N in static_string (#123) --- include/magic_enum.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 36b975a..daf4898 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -165,6 +165,7 @@ struct char_equal_to { template class static_string { +static_assert(N < UINT16_MAX, "Length of static_string must be less than UINT16_MAX."); public: constexpr explicit static_string(string_view str) noexcept : static_string{str, std::make_index_sequence{}} { assert(str.size() == N);