We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa03c23 commit a1a3894Copy full SHA for a1a3894
1 file changed
include/scale/detail/enum.hpp
@@ -62,7 +62,7 @@ namespace scale {
62
* @tparam V The enum value.
63
*/
64
template <auto EnumValue>
65
- std::string_view enum_name_impl() {
+ constexpr std::string_view enum_name_impl() {
66
constexpr std::string_view func = ENUM_NAME_PRETTY_FUNCTION;
67
constexpr std::size_t prefix_pos = func.find(enum_prefix);
68
assert(prefix_pos != std::string_view::npos);
@@ -72,8 +72,7 @@ namespace scale {
72
constexpr std::string_view full = func.substr(start, end - start);
73
constexpr std::size_t colons = full.rfind("::");
74
if (colons == std::string_view::npos) return {}; // Invalid, no namespace
75
- constexpr std::string_view result = full.substr(colons + 2);
76
- return result;
+ return full.substr(colons + 2);
77
}
78
79
/**
0 commit comments