Merge pull request 'fix compiler warning for fixed array list copy ctor' (#704) from eive/fsfw:mueller/fixed_array_list_copy_ctor into development
Reviewed-on: fsfw/fsfw#704
This commit is contained in:
commit
0956fbc740
@ -20,15 +20,19 @@ class FixedArrayList : public ArrayList<T, count_t> {
|
|||||||
FixedArrayList() : ArrayList<T, count_t>(data, MAX_SIZE) {}
|
FixedArrayList() : ArrayList<T, count_t>(data, MAX_SIZE) {}
|
||||||
|
|
||||||
FixedArrayList(const FixedArrayList& other) : ArrayList<T, count_t>(data, MAX_SIZE) {
|
FixedArrayList(const FixedArrayList& other) : ArrayList<T, count_t>(data, MAX_SIZE) {
|
||||||
memcpy(this->data, other.data, sizeof(this->data));
|
|
||||||
this->entries = data;
|
this->entries = data;
|
||||||
this->size = other.size;
|
this->size = other.size;
|
||||||
|
for (size_t idx = 0; idx < this->size; idx++) {
|
||||||
|
data[idx] = other.data[idx];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FixedArrayList& operator=(FixedArrayList other) {
|
FixedArrayList& operator=(FixedArrayList other) {
|
||||||
memcpy(this->data, other.data, sizeof(this->data));
|
|
||||||
this->entries = data;
|
this->entries = data;
|
||||||
this->size = other.size;
|
this->size = other.size;
|
||||||
|
for (size_t idx = 0; idx < this->size; idx++) {
|
||||||
|
data[idx] = other.data[idx];
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user