qvec: add constructor to extend a vector

This commit is contained in:
Eric Wasylishen 2021-02-06 14:11:01 -07:00
parent 32d3fb7f10
commit 86a644680a
1 changed files with 10 additions and 0 deletions

View File

@ -99,6 +99,16 @@ public:
v[i] = 0;
}
/**
* Extending a vector
*/
qvec(const qvec<N-1, T> &other, T value) {
for (int i = 0; i < N - 1; ++i) {
v[i] = other[i];
}
v[N-1] = value;
}
bool operator==(const qvec<N,T> &other) const {
for (int i=0; i<N; i++)
if (v[i] != other.v[i])