mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 16:13:53 +00:00
Allow copy policy in smart holder caster for shared_ptr
This commit is contained in:
parent
2934913761
commit
c807807c55
@ -629,6 +629,7 @@ 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::copy
|
||||
&& policy != return_value_policy::automatic_reference) {
|
||||
// SMART_HOLDER_WIP: IMPROVABLE: Error message.
|
||||
throw cast_error("Invalid return_value_policy for shared_ptr.");
|
||||
|
Loading…
Reference in New Issue
Block a user