aboutsummaryrefslogtreecommitdiff
path: root/ports/pybind11/aliastemplates.patch
blob: a692ad583fa019a857122e9c5e2f43e5ae5fe5c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 598ec67e4d6727dd9455bcc9959e32fee02a80ac Mon Sep 17 00:00:00 2001
From: Michael Goulding <Michael.Goulding@microsoft.com>
Date: Wed, 18 Jul 2018 10:59:15 -0700
Subject: [PATCH 1/2] VS 15.8.0 Preview 4.0 has a bug with alias templates

---
 include/pybind11/detail/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h
index 3c6722891..89d922190 100644
--- a/include/pybind11/detail/common.h
+++ b/include/pybind11/detail/common.h
@@ -476,7 +476,7 @@ template <typename...> struct void_t_impl { using type = void; };
 template <typename... Ts> using void_t = typename void_t_impl<Ts...>::type;
 
 /// Compile-time all/any/none of that check the boolean value of all template types
-#ifdef __cpp_fold_expressions
+#if (!defined(_MSC_VER) || ( _MSC_VER >= 1916 )) && defined(__cpp_fold_expressions)
 template <class... Ts> using all_of = bool_constant<(Ts::value && ...)>;
 template <class... Ts> using any_of = bool_constant<(Ts::value || ...)>;
 #elif !defined(_MSC_VER)

From 7d534251ca67c5e725ed549900f04adeb5ddb99e Mon Sep 17 00:00:00 2001
From: Michael Goulding <Michael.Goulding@microsoft.com>
Date: Thu, 19 Jul 2018 10:27:41 -0700
Subject: [PATCH 2/2] Address feedback

---
 include/pybind11/detail/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h
index 89d922190..8d65b260d 100644
--- a/include/pybind11/detail/common.h
+++ b/include/pybind11/detail/common.h
@@ -476,7 +476,7 @@ template <typename...> struct void_t_impl { using type = void; };
 template <typename... Ts> using void_t = typename void_t_impl<Ts...>::type;
 
 /// Compile-time all/any/none of that check the boolean value of all template types
-#if (!defined(_MSC_VER) || ( _MSC_VER >= 1916 )) && defined(__cpp_fold_expressions)
+#if defined(__cpp_fold_expressions) && !(defined(_MSC_VER) && (_MSC_VER < 1916))
 template <class... Ts> using all_of = bool_constant<(Ts::value && ...)>;
 template <class... Ts> using any_of = bool_constant<(Ts::value || ...)>;
 #elif !defined(_MSC_VER)