Adding minor comment (change to internals needed to distinguish uninitialized/disowned in error message).

This commit is contained in:
Ralf W. Grosse-Kunstleve 2021-01-15 16:52:09 -08:00
parent a72e5f0c8f
commit 2f8e01748b

View File

@ -64,7 +64,8 @@ struct smart_holder_type_caster_load {
auto inst = reinterpret_cast<instance *>(src.ptr());
loaded_v_h = inst->get_value_and_holder(get_type_info(typeid(T)));
if (!loaded_v_h.holder_constructed()) {
// IMPROVEABLE: Error message.
// IMPROVEABLE: Error message. A change to the existing internals is
// needed to cleanly distinguish between uninitialized or disowned.
throw std::runtime_error("Missing value for wrapped C++ type:"
" Python instance is uninitialized or was disowned.");
}