mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:14:58 +00:00
AK: Delete Vector::resize() from Nonnull{Own,Ref}PtrVector.
It's not possible to grow one of these vectors beyond what's already in them since it's not possible to default-construct Nonnull{Own,Ref}Ptr. Add Vector::shrink() which can be used when you want to shrink the Vector and delete resize() from the specialized Vectors.
This commit is contained in:
parent
394168c0ca
commit
1686c4906b
3 changed files with 27 additions and 9 deletions
|
@ -41,6 +41,12 @@ public:
|
|||
const T& first() const { return at(0); }
|
||||
T& last() { return at(size() - 1); }
|
||||
const T& last() const { return at(size() - 1); }
|
||||
|
||||
private:
|
||||
// NOTE: You can't use resize() on a NonnullOwnPtrVector since making the vector
|
||||
// bigger would require being able to default-construct NonnullOwnPtrs.
|
||||
// Instead, use shrink(new_size).
|
||||
void resize(int) = delete;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue