Allow move policy in smart holder caster for shared_ptr

This commit is contained in:
Jakob Lykke Andersen 2021-06-19 16:40:51 +02:00 committed by Ralf W. Grosse-Kunstleve
parent 660f83e81d
commit be60fc52a4

View File

@ -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.");
}