From bce8a4b95c79f0705ef4b746d3ad634ecdcbb83c Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 6 Mar 2016 13:30:10 +0100 Subject: [PATCH] force explicit cast (fixes #130) --- include/pybind11/cast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 8547f283..12cc5b28 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -567,7 +567,7 @@ template inline T cast(handle handle) { detail::type_caster::type> conv; if (!conv.load(handle, true)) throw cast_error("Unable to cast Python object to C++ type"); - return conv; + return (T) conv; } template inline object cast(const T &value, return_value_policy policy = return_value_policy::automatic, handle parent = handle()) {