From ad7bc01d516c39829238a4a2b4db7d8f8a30a8f9 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 20 Oct 2015 01:09:53 +0200 Subject: [PATCH] fix build on linux --- include/pybind11/cast.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index a6f45efc4..aa3001b06 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -197,11 +197,11 @@ public: } operator type*() { return (type *) value; } - operator type&() { return (type &) *value; } + operator type&() { return *((type *) value); } protected: template ::value, int>::type = 0> static void *copy_constructor(const void *arg) { - return new type((const type &)*arg); + return new type(*((const type *)arg)); } template ::value, int>::type = 0> static void *copy_constructor(const void *) { return nullptr; }