MCPcopy Create free account
hub / github.com/pybind/pybind11 / load_value

Method load_value

include/pybind11/cast.h:918–932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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>

Callers

nothing calls this directly

Calls 1

holder_constructedMethod · 0.80

Tested by

no test coverage detected