From 06598d15950f15ad9cf739d1949ab4d4a3fff622 Mon Sep 17 00:00:00 2001 From: neargye Date: Tue, 30 May 2023 17:58:31 +0400 Subject: [PATCH] remove unnecessary func --- include/magic_enum.hpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index dfa22ddfc..50146e1be 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -242,17 +242,13 @@ struct range_max::max)>> : std: struct str_view { const char* str_ = nullptr; std::size_t size_ = 0; - - constexpr const char* data() const noexcept { return str_; } - - constexpr std::size_t size() const noexcept { return size_; } }; template class static_str { public: constexpr explicit static_str(str_view str) noexcept : static_str{str.str_, std::make_integer_sequence{}} { - assert(str.size() == N); + assert(str.size_ == N); } constexpr explicit static_str(string_view str) noexcept : static_str{str.data(), std::make_integer_sequence{}} { @@ -454,7 +450,7 @@ constexpr auto type_name() noexcept { return static_str<0>{}; } else if constexpr (custom.first == customize::detail::customize_tag::default_tag) { constexpr auto name = n(); - return static_str{name}; + return static_str{name}; } else { static_assert(always_false_v, "magic_enum::customize invalid."); } @@ -524,7 +520,7 @@ constexpr auto enum_name() noexcept { return static_str<0>{}; } else if constexpr (custom.first == customize::detail::customize_tag::default_tag) { constexpr auto name = n(); - return static_str{name}; + return static_str{name}; } else { static_assert(always_false_v, "magic_enum::customize invalid."); } @@ -548,7 +544,7 @@ constexpr bool is_valid() noexcept { static_assert(!name.empty(), "magic_enum::customize requires not empty string."); return name.size() != 0; } else if constexpr (custom.first == customize::detail::customize_tag::default_tag) { - return n().size() != 0; + return n().size_ != 0; } else { return false; }