We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b6b3393 commit 24259b0Copy full SHA for 24259b0
c++/cpp2py/converters/vector.hpp
@@ -23,8 +23,8 @@ namespace cpp2py {
23
npy_type<std::remove_const_t<T>>,
24
(void *)vec_heap->data(),
25
std::is_const_v<T>,
26
- v_t{static_cast<long>(v.size())}, // extents
27
- v_t{sizeof(T)}, // strides
+ v_t{static_cast<long>(vec_heap->size())}, // extents
+ v_t{sizeof(T)}, // strides
28
capsule};
29
}
30
@@ -52,7 +52,7 @@ namespace cpp2py {
52
} else { // Convert to Python List
53
PyObject *list = PyList_New(0);
54
for (auto const &x : v) {
55
- pyref y = py_converter<T>::c2py(std::move(x));
+ pyref y = py_converter<std::decay_t<T>>::c2py(std::move(x));
56
if (y.is_null() or (PyList_Append(list, y) == -1)) {
57
Py_DECREF(list);
58
return NULL;
0 commit comments