| 542 | } |
| 543 | |
| 544 | bool load(handle src, bool convert) { |
| 545 | if (!src) { |
| 546 | return false; |
| 547 | } |
| 548 | if (src.is_none()) { |
| 549 | return true; // default-constructed value is already empty |
| 550 | } |
| 551 | value_conv inner_caster; |
| 552 | if (!inner_caster.load(src, convert)) { |
| 553 | return false; |
| 554 | } |
| 555 | |
| 556 | value.emplace(cast_op<Value &&>(std::move(inner_caster))); |
| 557 | return true; |
| 558 | } |
| 559 | |
| 560 | PYBIND11_TYPE_CASTER(Type, value_conv::name | make_caster<none>::name); |
| 561 | }; |