util/AllocatedArray: remove bogus assertions
`new T[0]` must not be nullptr.
This commit is contained in:
parent
aee861c009
commit
561ccf600f
@ -58,9 +58,7 @@ public:
|
|||||||
constexpr AllocatedArray() = default;
|
constexpr AllocatedArray() = default;
|
||||||
|
|
||||||
explicit AllocatedArray(size_type _size) noexcept
|
explicit AllocatedArray(size_type _size) noexcept
|
||||||
:buffer{new T[_size], _size} {
|
:buffer{new T[_size], _size} {}
|
||||||
assert(size() == 0 || buffer.data != nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
explicit AllocatedArray(const AllocatedArray &other) noexcept {
|
explicit AllocatedArray(const AllocatedArray &other) noexcept {
|
||||||
assert(other.size() == 0 || other.buffer.data != nullptr);
|
assert(other.size() == 0 || other.buffer.data != nullptr);
|
||||||
@ -190,8 +188,6 @@ public:
|
|||||||
delete[] buffer.data;
|
delete[] buffer.data;
|
||||||
buffer.size = _size;
|
buffer.size = _size;
|
||||||
buffer.data = new T[buffer.size];
|
buffer.data = new T[buffer.size];
|
||||||
|
|
||||||
assert(size() == 0 || buffer.data != nullptr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -213,7 +209,6 @@ public:
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
T *new_data = new T[_size];
|
T *new_data = new T[_size];
|
||||||
assert(_size == 0 || new_data != nullptr);
|
|
||||||
|
|
||||||
std::move(buffer.data, buffer.data + preserve, new_data);
|
std::move(buffer.data, buffer.data + preserve, new_data);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user