From 37b49d96bb41084dde895f0e7a2c3976db17b4e5 Mon Sep 17 00:00:00 2001 From: Ruochun Date: Sat, 10 May 2025 18:13:59 +0800 Subject: [PATCH] Add one-liner fix for MSVC --- jitify.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jitify.hpp b/jitify.hpp index 1247ef8..cd08d00 100644 --- a/jitify.hpp +++ b/jitify.hpp @@ -852,8 +852,12 @@ struct type_reflection { // WAR for typeid discarding cv qualifiers on value-types // Wrap type in dummy template class to preserve cv-qualifiers, then strip // off the wrapper from the resulting string. - std::string wrapped_name = + #ifdef _MSC_VER + std::string wrapped_name = typeid(JitifyTypeNameWrapper_).name(); + #else + std::string wrapped_name = demangle_native_type(typeid(JitifyTypeNameWrapper_)); + #endif // Note: The reflected name of this class also has namespace prefixes. const std::string wrapper_class_name = "JitifyTypeNameWrapper_<"; size_t start = wrapped_name.find(wrapper_class_name);