| 916 | } |
| 917 | |
| 918 | void load_value(value_and_holder &&v_h) { |
| 919 | if (v_h.holder_constructed()) { |
| 920 | value = v_h.value_ptr(); |
| 921 | holder = v_h.template holder<holder_type>(); |
| 922 | return; |
| 923 | } |
| 924 | throw cast_error("Unable to cast from non-held to held instance (T& to Holder<T>) " |
| 925 | #if !defined(PYBIND11_DETAILED_ERROR_MESSAGES) |
| 926 | "(#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for " |
| 927 | "type information)"); |
| 928 | #else |
| 929 | "of type '" |
| 930 | + type_id<holder_type>() + "''"); |
| 931 | #endif |
| 932 | } |
| 933 | |
| 934 | template <typename T = holder_type, |
| 935 | detail::enable_if_t<!std::is_constructible<T, const T &, type *>::value, int> = 0> |
nothing calls this directly
no test coverage detected