MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / getVector

Function getVector

quest/src/core/utilities.cpp:1162–1170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1160
1161template <typename T>
1162vector<T> getVector(T* ptr, int length) {
1163
1164 // permit nullptr to indicate empty list, regardless of length
1165 if (ptr == nullptr)
1166 return {};
1167
1168 // assumes memory alloc failure is impossible
1169 return vector<T> (ptr, ptr + length);
1170}
1171
1172vector<int> util_getVector(int* ptr, int length) { return getVector(ptr, length); }
1173vector<qreal> util_getVector(qreal* ptr, int length) { return getVector(ptr, length); }

Callers 1

util_getVectorFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected