summaryrefslogtreecommitdiff
path: root/AK/NonnullRefPtrVector.h
AgeCommit message (Collapse)Author
2021-06-11AK: Make NonnullRefPtrVector constructible from Vector<NonnullRefPtr>Ali Mohammad Pur
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-02-20AK: Make Nonnull*PtrVector use size_t for indexesAndreas Kling
This was weird. It turns out these class were using int indexes and sizes despite being derived from Vector which uses size_t. Make the universe right again by using size_t here as well.
2020-12-08AK: Forward declare Nonnull{Own,Ref}PtrVectorAnotherTest
2020-09-25Meta+AK: Make clang-format-10 cleanBen Wiederhake
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2019-07-25AK: Simplify NonnullPtrVector template a bit.Andreas Kling
Add an "ElementType" typedef to NonnullOwnPtr and NonnullRefPtr to allow clients to easily find the pointee type. Then use this to remove a template argument from NonnullPtrVector. :^)
2019-07-25AK: Share code between NonnullOwnPtrVector and NonnullRefPtrVector.Andreas Kling
These can just inherit from a shared base template. Thanks to Robin for the sweet idea :^)
2019-07-24AK: Delete Vector::resize() from Nonnull{Own,Ref}PtrVector.Andreas Kling
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.
2019-06-27AK: Get rid of ConstVectorIterator.Andreas Kling
We can achieve the same with just a VectorIterator<const Vector, const T>.
2019-06-27AK: NonnullRefPtrVector should use Vector<T, inline_capacity> as its base.Andreas Kling
We were forgetting to plumb through the inline capacity in the Base typedef.
2019-06-27AK: Allow constructing an empty NonnullRefPtrVector.Andreas Kling
2019-06-27AK: Support range-for iteration over a NonnullRefPtrVector<T>.Andreas Kling
This means you can now do this: void harmonize(NonnullRefPtrVector<Voice>& voices) { for (auto& voice : voices) { voice.sing(); // Look, no "->"! } } Pretty dang cool :^)
2019-06-27AK: Add NonnullRefPtrVector<T>.Andreas Kling
This is a slot-in convenience replacement for Vector<NonnullRefPtr<T>> that makes accessors return T& instead of NonnullRefPtr<T>&. Since NonnullRefPtr guarantees non-nullness, this allows you to access these vector elements using dot (.) rather than arrow (->). :^)