From 30618cd15653843895b060a66c64c5c8b49aed05 Mon Sep 17 00:00:00 2001 From: terik23 Date: Tue, 26 Mar 2019 21:49:12 +0500 Subject: [PATCH] auto template --- include/nameof.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index 04292c5..407470a 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -160,7 +160,7 @@ template #endif } -template +template [[nodiscard]] constexpr std::string_view nameof_enum_impl() noexcept { #if defined(__clang__) std::string_view name{__PRETTY_FUNCTION__}; @@ -196,21 +196,21 @@ struct nameof_enum_impl_t final { switch (value - V) { case 0: - return nameof_enum_impl(V)>(); + return nameof_enum_impl(V)>(); case 1: - return nameof_enum_impl(V + 1)>(); + return nameof_enum_impl(V + 1)>(); case 2: - return nameof_enum_impl(V + 2)>(); + return nameof_enum_impl(V + 2)>(); case 3: - return nameof_enum_impl(V + 3)>(); + return nameof_enum_impl(V + 3)>(); case 4: - return nameof_enum_impl(V + 4)>(); + return nameof_enum_impl(V + 4)>(); case 5: - return nameof_enum_impl(V + 5)>(); + return nameof_enum_impl(V + 5)>(); case 6: - return nameof_enum_impl(V + 6)>(); + return nameof_enum_impl(V + 6)>(); case 7: - return nameof_enum_impl(V + 7)>(); + return nameof_enum_impl(V + 7)>(); default: return nameof_enum_impl_t{}(value); } @@ -246,7 +246,7 @@ template // nameof_enum used to obtain the simple (unqualified) string enum name of static storage enum variable. template >>> [[nodiscard]] constexpr std::string_view nameof_enum() noexcept { - return detail::nameof_enum_impl(); + return detail::nameof_enum_impl(); } // nameof_type used to obtain the string name of type.