From 6db9794dc65cdebd64663f6c9bb0213b42c7df57 Mon Sep 17 00:00:00 2001 From: Jeremy <51220084+jeremy-rifkin@users.noreply.github.com> Date: Sun, 3 Dec 2023 21:33:31 -0500 Subject: [PATCH] Workaround a msvc bug affecting msvc 19.38 --- src/utils/utils.hpp | 52 ++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/src/utils/utils.hpp b/src/utils/utils.hpp index eac96ce..1677aa5 100644 --- a/src/utils/utils.hpp +++ b/src/utils/utils.hpp @@ -363,19 +363,23 @@ namespace detail { template< typename T, - typename D, - typename std::enable_if< - std::is_same()(std::declval())), void>::value, - int - >::type = 0, - typename std::enable_if< - std::is_standard_layout::value && std::is_trivial::value, - int - >::type = 0, - typename std::enable_if< - std::is_nothrow_move_constructible::value, - int - >::type = 0 + typename D + // workaround a msvc bug https://developercommunity.visualstudio.com/t/MSVC-1938331290-preview-fails-to-comp/10505565 + #if _MSC_VER != 1938 + , + typename std::enable_if< + std::is_same()(std::declval())), void>::value, + int + >::type = 0, + typename std::enable_if< + std::is_standard_layout::value && std::is_trivial::value, + int + >::type = 0, + typename std::enable_if< + std::is_nothrow_move_constructible::value, + int + >::type = 0 + #endif > class raii_wrapper { T obj; @@ -409,15 +413,19 @@ namespace detail { template< typename T, - typename D, - typename std::enable_if< - std::is_same()(std::declval())), void>::value, - int - >::type = 0, - typename std::enable_if< - std::is_standard_layout::value && std::is_trivial::value, - int - >::type = 0 + typename D + // workaround a msvc bug https://developercommunity.visualstudio.com/t/MSVC-1938331290-preview-fails-to-comp/10505565 + #if _MSC_VER != 1938 + , + typename std::enable_if< + std::is_same()(std::declval())), void>::value, + int + >::type = 0, + typename std::enable_if< + std::is_standard_layout::value && std::is_trivial::value, + int + >::type = 0 + #endif > raii_wrapper::type, D> raii_wrap(T obj, D deleter) { return raii_wrapper::type, D>(obj, deleter);