From 819dfa52a13fde2bc3fd2247b10acea3cd27201b Mon Sep 17 00:00:00 2001 From: ZezhengLi Date: Wed, 11 Sep 2024 18:16:34 +0800 Subject: [PATCH] fix msvc --- cmake/subdir.cmake | 4 ---- include/ylt/reflection/member_count.hpp | 10 +++++----- include/ylt/reflection/member_ptr.hpp | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/cmake/subdir.cmake b/cmake/subdir.cmake index 02013f980..3cddaf591 100644 --- a/cmake/subdir.cmake +++ b/cmake/subdir.cmake @@ -22,10 +22,6 @@ endif() foreach(child ${children}) get_filename_component(subdir_name ${child} NAME) string(TOUPPER ${subdir_name} subdir_name) - if((${subdir_name} STREQUAL "STRUCT_PACK" OR ${subdir_name} STREQUAL "STRUCT_PB") AND (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")) - message(STATUS "skip ${subdir_name}") - continue() - endif() if (BUILD_${subdir_name}) message(STATUS "BUILD_${subdir_name}: ${BUILD_${subdir_name}}") diff --git a/include/ylt/reflection/member_count.hpp b/include/ylt/reflection/member_count.hpp index 3932c580d..7b810fe83 100644 --- a/include/ylt/reflection/member_count.hpp +++ b/include/ylt/reflection/member_count.hpp @@ -11,7 +11,10 @@ #endif #include "user_reflect_macro.hpp" - +namespace struct_pack { + template + struct compatible; +} namespace ylt::reflection { template using remove_cvref_t = std::remove_cv_t>; @@ -87,14 +90,11 @@ template constexpr bool tuple_size = tuple_size_impl::value; #endif -template -struct compatible; - template constexpr inline bool is_compatible_v = false; template -constexpr inline bool is_compatible_v> = true; +constexpr inline bool is_compatible_v> = true; struct UniversalVectorType { template diff --git a/include/ylt/reflection/member_ptr.hpp b/include/ylt/reflection/member_ptr.hpp index fec004ec9..1fa090e9d 100644 --- a/include/ylt/reflection/member_ptr.hpp +++ b/include/ylt/reflection/member_ptr.hpp @@ -3,7 +3,7 @@ // modified based on: // https://github.com/getml/reflect-cpp/blob/main/include/rfl/internal/bind_fake_object_to_tuple.hpp -// thanks for alxn4's greate idea! +// thanks for alxn4's great idea! namespace ylt::reflection { namespace internal {