Commit bce8a4b9 by Wenzel Jakob

force explicit cast (fixes #130)

parent 98e92108
...@@ -567,7 +567,7 @@ template <typename T> inline T cast(handle handle) { ...@@ -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()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment