From 4879da4e8cd89e07d4f78496454fba49fa73f3eb Mon Sep 17 00:00:00 2001 From: MiroKaku <50670906+MiroKaku@users.noreply.github.com> Date: Sat, 21 Dec 2024 11:42:50 +0800 Subject: [PATCH] [fix][reflection][msvc]: warning C4127 --- include/ylt/reflection/template_string.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ylt/reflection/template_string.hpp b/include/ylt/reflection/template_string.hpp index 46a5cb0dc..dab011796 100644 --- a/include/ylt/reflection/template_string.hpp +++ b/include/ylt/reflection/template_string.hpp @@ -36,7 +36,7 @@ inline constexpr std::string_view type_string() { constexpr auto next1 = str.rfind(sample[pos + 3]); #if defined(_MSC_VER) constexpr std::size_t npos = str.find_first_of(" ", pos); - if (npos != std::string_view::npos) + if constexpr (npos != std::string_view::npos) return str.substr(npos + 1, next1 - npos - 1); else return str.substr(pos, next1 - pos);