From 5d4db414b9b7387e949afbc5c773e37534e59716 Mon Sep 17 00:00:00 2001 From: neargye Date: Wed, 9 Oct 2019 22:48:48 +0500 Subject: [PATCH] remove final from non virtual class --- include/nameof.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index 330bf8a..ffd0cf6 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -69,7 +69,7 @@ namespace nameof { // If need another range for all enum types by default, redefine the macro NAMEOF_ENUM_RANGE_MIN and NAMEOF_ENUM_RANGE_MAX. // If need another range for specific enum type, add specialization enum_range for necessary enum type. template -struct enum_range final { +struct enum_range { static_assert(std::is_enum_v, "nameof::enum_range requires enum type."); inline static constexpr int min = NAMEOF_ENUM_RANGE_MIN; inline static constexpr int max = NAMEOF_ENUM_RANGE_MAX; @@ -207,12 +207,12 @@ std::basic_ostream& operator<<(std::basic_ostream& o namespace detail { template -struct identity final { +struct identity { using type = T; }; template -struct nameof_type_supported final +struct nameof_type_supported #if defined(NAMEOF_TYPE_SUPPORTED) && NAMEOF_TYPE_SUPPORTED || defined(NAMEOF_TYPE_NO_CHECK_SUPPORT) : std::true_type {}; #else @@ -220,7 +220,7 @@ struct nameof_type_supported final #endif template -struct nameof_enum_supported final +struct nameof_enum_supported #if defined(NAMEOF_ENUM_SUPPORTED) && NAMEOF_ENUM_SUPPORTED || defined(NAMEOF_ENUM_NO_CHECK_SUPPORT) : std::true_type {}; #else @@ -228,7 +228,7 @@ struct nameof_enum_supported final #endif template -struct static_string final { +struct static_string { constexpr static_string(std::string_view str) noexcept : static_string{str, std::make_index_sequence{}} {} constexpr const char* data() const noexcept { return chars.data(); } @@ -245,7 +245,7 @@ struct static_string final { }; template <> -struct static_string<0> final { +struct static_string<0> { constexpr static_string(std::string_view) noexcept {} constexpr const char* data() const noexcept { return nullptr; } @@ -499,7 +499,7 @@ constexpr auto strings() noexcept { } template -class enum_traits final { +class enum_traits { static_assert(is_enum_v, "nameof::enum_traits requires enum type."); static_assert(enum_range::min > (std::numeric_limits::min)(), "nameof::enum_range requires min must be greater than INT16_MIN."); static_assert(enum_range::max < (std::numeric_limits::max)(), "nameof::enum_range requires max must be less than INT16_MAX.");