mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 08:32:02 +00:00
smart_holder_from_unique_ptr
: also accept return_value_policy::take_ownership
There are no strong reasons for accepting or rejecting `return_value_policy::take_ownership`. Accepting to accommodate existing use cases in the wild.
This commit is contained in:
parent
12f384bcbb
commit
ecd01da7ac
@ -635,7 +635,8 @@ handle smart_holder_from_unique_ptr(std::unique_ptr<T, D> &&src,
|
|||||||
const std::pair<const void *, const type_info *> &st) {
|
const std::pair<const void *, const type_info *> &st) {
|
||||||
if (policy != return_value_policy::automatic
|
if (policy != return_value_policy::automatic
|
||||||
&& policy != return_value_policy::automatic_reference
|
&& policy != return_value_policy::automatic_reference
|
||||||
&& policy != return_value_policy::move && policy != return_value_policy::reference
|
&& policy != return_value_policy::take_ownership && policy != return_value_policy::move
|
||||||
|
&& policy != return_value_policy::reference
|
||||||
&& policy != return_value_policy::reference_internal) {
|
&& policy != return_value_policy::reference_internal) {
|
||||||
// SMART_HOLDER_WIP: IMPROVABLE: Error message.
|
// SMART_HOLDER_WIP: IMPROVABLE: Error message.
|
||||||
throw cast_error("Invalid return_value_policy for unique_ptr.");
|
throw cast_error("Invalid return_value_policy for unique_ptr.");
|
||||||
|
Loading…
Reference in New Issue
Block a user