Skip to content

Commit

Permalink
fix Neargye#122 add static_assert to limit size of N in static_string (
Browse files Browse the repository at this point in the history
  • Loading branch information
rpatters1 authored and jamek committed Feb 11, 2022
1 parent 180307a commit d8dbe3e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/magic_enum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ struct char_equal_to {

template <std::size_t N>
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<N>{}} {
assert(str.size() == N);
Expand Down

0 comments on commit d8dbe3e

Please sign in to comment.