Skip to content

Commit 69769a9

Browse files
committed
Dummy implementation for casting from const std::unique_ptr&
Implementation is missing. If the instance is already registered, it should be returned with increase refcount. If not, a new instance must be created, which must not delete.
1 parent 3b66075 commit 69769a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/pybind11/detail/smart_holder_type_casters.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,9 @@ struct smart_holder_type_caster<std::unique_ptr<T, D>> : smart_holder_type_caste
698698

699699
return inst.release();
700700
}
701+
static handle cast(const std::unique_ptr<T, D> &src, return_value_policy policy, handle parent) {
702+
throw cast_error("Casting from const std::unique_ptr& not yet implemented.");
703+
}
701704

702705
template <typename>
703706
using cast_op_type = std::unique_ptr<T, D>;

0 commit comments

Comments
 (0)