From b90e68de7e839ba9953483c6a13a9d0e945420e1 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 27 Mar 2016 00:19:32 +0100 Subject: [PATCH] another corner case (fixes #151) --- include/pybind11/cast.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 976d28266..613742cf7 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -356,7 +356,8 @@ public: return handle(Py_None).inc_ref(); } - operator void *() { return value; } + template using cast_op_type = void*&; + operator void *&() { return value; } private: void *value = nullptr; };