Skip to content

Commit 73e3c34

Browse files
committed
converters: vector<T> for T not default constructible.
- just use push_back instead of a simple loop...
1 parent f7339c5 commit 73e3c34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/c2py/converters/stl/vector.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ namespace c2py {
5656
long size = p.extents[0];
5757
long step = p.strides[0] / sizeof(T);
5858

59-
std::vector<T> v(size);
59+
std::vector<T> v; //(size);
6060

6161
T *data = static_cast<T *>(p.data);
62-
for (long i = 0; i < size; ++i) v[i] = *(data + i * step);
62+
for (long i = 0; i < size; ++i) v.push_back(*(data + i * step));
6363

6464
return v;
6565
}

0 commit comments

Comments
 (0)