summaryrefslogtreecommitdiff
path: root/src/support
diff options
context:
space:
mode:
Diffstat (limited to 'src/support')
-rw-r--r--src/support/small_vector.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/support/small_vector.h b/src/support/small_vector.h
index 503dfbd5c..dd0370554 100644
--- a/src/support/small_vector.h
+++ b/src/support/small_vector.h
@@ -65,6 +65,12 @@ public:
using value_type = T;
SmallVector() {}
+ SmallVector(const SmallVector<T, N>& other)
+ : usedFixed(other.usedFixed), fixed(other.fixed), flexible(other.flexible) {
+ }
+ SmallVector(SmallVector<T, N>&& other)
+ : usedFixed(other.usedFixed), fixed(std::move(other.fixed)),
+ flexible(std::move(other.flexible)) {}
SmallVector(std::initializer_list<T> init) {
for (T item : init) {
push_back(item);
@@ -72,6 +78,20 @@ public:
}
SmallVector(size_t initialSize) { resize(initialSize); }
+ SmallVector<T, N>& operator=(const SmallVector<T, N>& other) {
+ usedFixed = other.usedFixed;
+ fixed = other.fixed;
+ flexible = other.flexible;
+ return *this;
+ }
+
+ SmallVector<T, N>& operator=(SmallVector<T, N>&& other) {
+ usedFixed = other.usedFixed;
+ fixed = std::move(other.fixed);
+ flexible = std::move(other.flexible);
+ return *this;
+ }
+
T& operator[](size_t i) {
if (i < N) {
return fixed[i];