[ox/std] Fix Vector copy constructor not to move items
This commit is contained in:
parent
db3c2602fd
commit
33775f59ff
13
deps/ox/src/ox/model/desctypes.hpp
vendored
13
deps/ox/src/ox/model/desctypes.hpp
vendored
@ -82,19 +82,24 @@ struct DescriptorField {
|
|||||||
|
|
||||||
~DescriptorField();
|
~DescriptorField();
|
||||||
|
|
||||||
const DescriptorField &operator=(DescriptorField &&other) noexcept {
|
const DescriptorField &operator=(const DescriptorField &other) noexcept {
|
||||||
type = other.type;
|
type = other.type;
|
||||||
fieldName = other.fieldName;
|
fieldName = other.fieldName;
|
||||||
subscriptLevels = other.subscriptLevels;
|
subscriptLevels = other.subscriptLevels;
|
||||||
typeName = other.typeName;
|
typeName = other.typeName;
|
||||||
ownsType = other.ownsType;
|
ownsType = other.ownsType;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
const DescriptorField &operator=(DescriptorField &&other) noexcept {
|
||||||
|
type = move(other.type);
|
||||||
other.type = {};
|
other.type = {};
|
||||||
other.fieldName = "";
|
fieldName = move(other.fieldName);
|
||||||
|
subscriptLevels = move(other.subscriptLevels);
|
||||||
other.subscriptLevels = {};
|
other.subscriptLevels = {};
|
||||||
other.typeName = "";
|
typeName = move(other.typeName);
|
||||||
|
ownsType = move(other.ownsType);
|
||||||
other.ownsType = {};
|
other.ownsType = {};
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
deps/ox/src/ox/std/vector.hpp
vendored
2
deps/ox/src/ox/std/vector.hpp
vendored
@ -301,7 +301,7 @@ Vector<T, SmallVectorSize>::Vector(const Vector &other) {
|
|||||||
m_cap = other.m_cap;
|
m_cap = other.m_cap;
|
||||||
this->initItems(&m_items, other.m_cap);
|
this->initItems(&m_items, other.m_cap);
|
||||||
for (std::size_t i = 0; i < m_size; ++i) {
|
for (std::size_t i = 0; i < m_size; ++i) {
|
||||||
m_items[i] = move(other.m_items[i]);
|
m_items[i] = other.m_items[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user