Skip to content

Commit a1a3894

Browse files
committed
fix: constexpr
Signed-off-by: Dmitriy Khaustov aka xDimon <khaustov.dm@gmail.com>
1 parent fa03c23 commit a1a3894

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

include/scale/detail/enum.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace scale {
6262
* @tparam V The enum value.
6363
*/
6464
template <auto EnumValue>
65-
std::string_view enum_name_impl() {
65+
constexpr std::string_view enum_name_impl() {
6666
constexpr std::string_view func = ENUM_NAME_PRETTY_FUNCTION;
6767
constexpr std::size_t prefix_pos = func.find(enum_prefix);
6868
assert(prefix_pos != std::string_view::npos);
@@ -72,8 +72,7 @@ namespace scale {
7272
constexpr std::string_view full = func.substr(start, end - start);
7373
constexpr std::size_t colons = full.rfind("::");
7474
if (colons == std::string_view::npos) return {}; // Invalid, no namespace
75-
constexpr std::string_view result = full.substr(colons + 2);
76-
return result;
75+
return full.substr(colons + 2);
7776
}
7877

7978
/**

0 commit comments

Comments
 (0)