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:
Ralf W. Grosse-Kunstleve 2024-07-15 01:33:15 -07:00
parent 12f384bcbb
commit ecd01da7ac

View File

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