|
|
3c181a |
From f2c465ffa508459216f7093bf95ba001ad994206 Mon Sep 17 00:00:00 2001
|
|
|
3c181a |
From: vslashg <veloso@verylowsodium.com>
|
|
|
3c181a |
Date: Mon, 29 Feb 2016 13:33:35 -0500
|
|
|
3c181a |
Subject: [PATCH] Fix auto-pointer registration in Boost Python 1.60.
|
|
|
3c181a |
|
|
|
3c181a |
The conditional instantiation magic of maybe_register_pointer_to_python() assumes that use_value_holder and use_back_reference will be one of the boost::mpl::bool_ types, but this assumption is no longer true in Boost 1.60, where they can be standard library bool wrappers instead.
|
|
|
3c181a |
|
|
|
3c181a |
Explicitly defining these types as mpl::bool_ classes fixes https://github.com/boostorg/python/issues/56.
|
|
|
3c181a |
---
|
|
|
3c181a |
include/boost/python/object/class_metadata.hpp | 12 +++++++-----
|
|
|
3c181a |
1 file changed, 7 insertions(+), 5 deletions(-)
|
|
|
3c181a |
|
|
|
3c181a |
diff --git a/include/boost/python/object/class_metadata.hpp b/include/boost/python/object/class_metadata.hpp
|
|
|
3c181a |
index c71cf67..5009c17 100644
|
|
|
3c181a |
--- a/include/boost/python/object/class_metadata.hpp
|
|
|
3c181a |
+++ b/include/boost/python/object/class_metadata.hpp
|
|
|
3c181a |
@@ -164,7 +164,7 @@ struct class_metadata
|
|
|
3c181a |
>::type held_type;
|
|
|
3c181a |
|
|
|
3c181a |
// Determine if the object will be held by value
|
|
|
3c181a |
- typedef is_convertible<held_type*,T*> use_value_holder;
|
|
|
3c181a |
+ typedef mpl::bool_<is_convertible<held_type*,T*>::value> use_value_holder;
|
|
|
3c181a |
|
|
|
3c181a |
// Compute the "wrapped type", that is, if held_type is a smart
|
|
|
3c181a |
// pointer, we're talking about the pointee.
|
|
|
3c181a |
@@ -175,10 +175,12 @@ struct class_metadata
|
|
|
3c181a |
>::type wrapped;
|
|
|
3c181a |
|
|
|
3c181a |
// Determine whether to use a "back-reference holder"
|
|
|
3c181a |
- typedef mpl::or_<
|
|
|
3c181a |
- has_back_reference<T>
|
|
|
3c181a |
- , is_same<held_type_arg,T>
|
|
|
3c181a |
- , is_base_and_derived<T,wrapped>
|
|
|
3c181a |
+ typedef mpl::bool_<
|
|
|
3c181a |
+ mpl::or_<
|
|
|
3c181a |
+ has_back_reference<T>
|
|
|
3c181a |
+ , is_same<held_type_arg,T>
|
|
|
3c181a |
+ , is_base_and_derived<T,wrapped>
|
|
|
3c181a |
+ >::value
|
|
|
3c181a |
> use_back_reference;
|
|
|
3c181a |
|
|
|
3c181a |
// Select the holder.
|