From 1146f76bded466f60a34918f3bf5be3bb65a848d Mon Sep 17 00:00:00 2001 From: Heiko Lewin Date: Mon, 8 Apr 2024 16:02:16 +0200 Subject: [PATCH] More elegant formulation --- include/rfl/internal/get_field_names.hpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/rfl/internal/get_field_names.hpp b/include/rfl/internal/get_field_names.hpp index 52efbd2e..ebb3e8ae 100644 --- a/include/rfl/internal/get_field_names.hpp +++ b/include/rfl/internal/get_field_names.hpp @@ -52,10 +52,7 @@ consteval auto get_field_name_str_view() { #endif #if defined(__clang__) const auto split = func_name.substr(0, func_name.size() - 2); - const auto possibly_prefixed = split.substr(split.find_last_of(".") + 1); - const auto separator_index = possibly_prefixed.find_last_of(":"); - if (separator_index == std::string_view::npos) return possibly_prefixed; - return possibly_prefixed.substr(separator_index + 1); + return split.substr(split.find_last_of(":.") + 1); #elif defined(__GNUC__) const auto split = func_name.substr(0, func_name.size() - 2); return split.substr(split.find_last_of(":") + 1);