diff --git a/include/eigenpy/std_unique_ptr.hpp b/include/eigenpy/std_unique_ptr.hpp index d144567066b1e1e4a7d877dfcd8856c7aeaa3499..dcb95dc372ba3d52d42f2da11685caeb5eaf9533 100644 --- a/include/eigenpy/std_unique_ptr.hpp +++ b/include/eigenpy/std_unique_ptr.hpp @@ -22,10 +22,11 @@ template <typename T> typename std::enable_if<is_class_or_union_remove_cvref<T>::value, PyObject*>::type unique_ptr_to_python(std::unique_ptr<T>&& x) { + typedef bp::objects::pointer_holder<std::unique_ptr<T>, T> holder_t; if (!x) { return bp::detail::none(); } else { - return bp::detail::make_owning_holder::execute(x.release()); + return bp::objects::make_ptr_instance<T, holder_t>::execute(x); } }