Skip to content

Commit 24259b0

Browse files
committed
Fix in vector.hpp converter
1 parent b6b3393 commit 24259b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: c++/cpp2py/converters/vector.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ namespace cpp2py {
2323
npy_type<std::remove_const_t<T>>,
2424
(void *)vec_heap->data(),
2525
std::is_const_v<T>,
26-
v_t{static_cast<long>(v.size())}, // extents
27-
v_t{sizeof(T)}, // strides
26+
v_t{static_cast<long>(vec_heap->size())}, // extents
27+
v_t{sizeof(T)}, // strides
2828
capsule};
2929
}
3030

@@ -52,7 +52,7 @@ namespace cpp2py {
5252
} else { // Convert to Python List
5353
PyObject *list = PyList_New(0);
5454
for (auto const &x : v) {
55-
pyref y = py_converter<T>::c2py(std::move(x));
55+
pyref y = py_converter<std::decay_t<T>>::c2py(std::move(x));
5656
if (y.is_null() or (PyList_Append(list, y) == -1)) {
5757
Py_DECREF(list);
5858
return NULL;

0 commit comments

Comments
 (0)