mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 21:25:13 +00:00
force explicit cast (fixes #130)
This commit is contained in:
parent
98e9210816
commit
bce8a4b95c
@ -567,7 +567,7 @@ template <typename T> inline T cast(handle handle) {
|
|||||||
detail::type_caster<typename detail::intrinsic_type<T>::type> conv;
|
detail::type_caster<typename detail::intrinsic_type<T>::type> conv;
|
||||||
if (!conv.load(handle, true))
|
if (!conv.load(handle, true))
|
||||||
throw cast_error("Unable to cast Python object to C++ type");
|
throw cast_error("Unable to cast Python object to C++ type");
|
||||||
return conv;
|
return (T) conv;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> inline object cast(const T &value, return_value_policy policy = return_value_policy::automatic, handle parent = handle()) {
|
template <typename T> inline object cast(const T &value, return_value_policy policy = return_value_policy::automatic, handle parent = handle()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user