Skip to content

Commit 325b522

Browse files
committed
Allow copy policy in smart holder caster for shared_ptr
1 parent 1ca44cb commit 325b522

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/pybind11/detail/smart_holder_type_casters.h

+1
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ struct smart_holder_type_caster<std::shared_ptr<T>> : smart_holder_type_caster_l
625625
static handle cast(const std::shared_ptr<T> &src, return_value_policy policy, handle parent) {
626626
if (policy != return_value_policy::automatic
627627
&& policy != return_value_policy::reference_internal
628+
&& policy != return_value_policy::copy
628629
&& policy != return_value_policy::automatic_reference) {
629630
// SMART_HOLDER_WIP: IMPROVABLE: Error message.
630631
throw cast_error("Invalid return_value_policy for shared_ptr.");

0 commit comments

Comments
 (0)