| 531 | |
| 532 | template <typename T> |
| 533 | static handle cast(T &&src, return_value_policy policy, handle parent) { |
| 534 | if (!src) { |
| 535 | return none().release(); |
| 536 | } |
| 537 | if (!std::is_lvalue_reference<T>::value) { |
| 538 | policy = return_value_policy_override<Value>::policy(policy); |
| 539 | } |
| 540 | // NOLINTNEXTLINE(bugprone-unchecked-optional-access) |
| 541 | return value_conv::cast(*std::forward<T>(src), policy, parent); |
| 542 | } |
| 543 | |
| 544 | bool load(handle src, bool convert) { |
| 545 | if (!src) { |