Skip to content

Commit ad7bc01

Browse files
author
Wenzel Jakob
committed
fix build on linux
1 parent 436b731 commit ad7bc01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/pybind11/cast.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ template <typename type> class type_caster : public type_caster_custom {
197197
}
198198

199199
operator type*() { return (type *) value; }
200-
operator type&() { return (type &) *value; }
200+
operator type&() { return *((type *) value); }
201201
protected:
202202
template <typename T = type, typename std::enable_if<std::is_copy_constructible<T>::value, int>::type = 0>
203203
static void *copy_constructor(const void *arg) {
204-
return new type((const type &)*arg);
204+
return new type(*((const type *)arg));
205205
}
206206
template <typename T = type, typename std::enable_if<!std::is_copy_constructible<T>::value, int>::type = 0>
207207
static void *copy_constructor(const void *) { return nullptr; }

0 commit comments

Comments
 (0)