From fac0f5e5237a38cf180e39ddd79e9a563634b0d7 Mon Sep 17 00:00:00 2001 From: MeeSong <50670906+MiroKaku@users.noreply.github.com> Date: Mon, 23 Dec 2024 16:47:26 +0800 Subject: [PATCH] [reflection][fix][msvc]: warning C4127 (#865) --- 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);