mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-30 08:57:11 +00:00
Allow move policy in smart holder caster for shared_ptr
This commit is contained in:
parent
660f83e81d
commit
be60fc52a4
@ -628,9 +628,12 @@ struct smart_holder_type_caster<std::shared_ptr<T>> : smart_holder_type_caster_l
|
||||
|
||||
static handle cast(const std::shared_ptr<T> &src, return_value_policy policy, handle parent) {
|
||||
if (policy != return_value_policy::automatic
|
||||
&& policy != return_value_policy::reference_internal
|
||||
&& policy != return_value_policy::automatic_reference
|
||||
// (but not take_ownership)
|
||||
&& policy != return_value_policy::copy
|
||||
&& policy != return_value_policy::automatic_reference) {
|
||||
&& policy != return_value_policy::move
|
||||
// (but not reference)
|
||||
&& policy != return_value_policy::reference_internal) {
|
||||
// SMART_HOLDER_WIP: IMPROVABLE: Error message.
|
||||
throw cast_error("Invalid return_value_policy for shared_ptr.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user