We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 436b731 commit ad7bc01Copy full SHA for ad7bc01
include/pybind11/cast.h
@@ -197,11 +197,11 @@ template <typename type> class type_caster : public type_caster_custom {
197
}
198
199
operator type*() { return (type *) value; }
200
- operator type&() { return (type &) *value; }
+ operator type&() { return *((type *) value); }
201
protected:
202
template <typename T = type, typename std::enable_if<std::is_copy_constructible<T>::value, int>::type = 0>
203
static void *copy_constructor(const void *arg) {
204
- return new type((const type &)*arg);
+ return new type(*((const type *)arg));
205
206
template <typename T = type, typename std::enable_if<!std::is_copy_constructible<T>::value, int>::type = 0>
207
static void *copy_constructor(const void *) { return nullptr; }
0 commit comments