Skip to content

Commit f2c465f

Browse files
committed
Fix auto-pointer registration in Boost Python 1.60.
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. Explicitly defining these types as mpl::bool_ classes fixes boostorg#56.
1 parent 359b7f0 commit f2c465f

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

include/boost/python/object/class_metadata.hpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct class_metadata
164164
>::type held_type;
165165

166166
// Determine if the object will be held by value
167-
typedef is_convertible<held_type*,T*> use_value_holder;
167+
typedef mpl::bool_<is_convertible<held_type*,T*>::value> use_value_holder;
168168

169169
// Compute the "wrapped type", that is, if held_type is a smart
170170
// pointer, we're talking about the pointee.
@@ -175,10 +175,12 @@ struct class_metadata
175175
>::type wrapped;
176176

177177
// Determine whether to use a "back-reference holder"
178-
typedef mpl::or_<
179-
has_back_reference<T>
180-
, is_same<held_type_arg,T>
181-
, is_base_and_derived<T,wrapped>
178+
typedef mpl::bool_<
179+
mpl::or_<
180+
has_back_reference<T>
181+
, is_same<held_type_arg,T>
182+
, is_base_and_derived<T,wrapped>
183+
>::value
182184
> use_back_reference;
183185

184186
// Select the holder.

0 commit comments

Comments
 (0)