summaryrefslogtreecommitdiff
path: root/AK/NonnullPtrVector.h
AgeCommit message (Collapse)Author
2023-02-21AK: Stop NonnullPtrVector from making accessed elements constAndreas Kling
2022-09-08AK: Allow creating NonnullPtrVectors from an initializer listSam Atkins
This was present in Vector already. Clang-format fixed some const positions automatically too. Also removed a now-ambiguous and unnecessary constructor from Shell.
2022-04-13LibWeb: Make reverse iterators work for const NonnullPtrVectorsAndreas Kling
2022-04-06AK: Add find_first_index to NonnullPtrVector that strips smart pointerkleines Filmröllchen
When we want to use the find_first_index that base Vector provides, we need to provide an element of the real contained type. That's impossible for OwnPtr, however, and even with RefPtr there might be instances where we have a raw reference to the object we want to find, but no smart pointer. Therefore, overloading this function (with an identical body, the magic is done by the find_index templatization) with `T const&` as a parameter allows there use cases.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-18AK: Add const variant of Vector::in_reverse()Andreas Kling
2022-03-09AK: Add reverse iterator as memberFederico Guerinoni
2022-03-09AK: Implement ReverseIterator for NonnullPtrVectorFederico Guerinoni
2021-09-16AK: Use default constructor/destructor instead of declaring an empty oneBrian Gianforcaro
Default implementations allow for more optimizations. See: https://pvs-studio.com/en/docs/warnings/v832/
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-11-23AK: Use ALWAYS_INLINE all over NonnullPtrVectorAndreas Kling
I saw NonnullOwnPtrVector::at() in a profile and that was silly, as we should definitely be inlining it.
2020-11-12AK: Prefer using instead of typedefLenny Maiorani
Problem: - `typedef` is a keyword which comes from C and carries with it old syntax that is hard to read. - Creating type aliases with the `using` keyword allows for easier future maintenance because it supports template syntax. - There is inconsistent use of `typedef` vs `using`. Solution: - Use `clang-tidy`'s checker called `modernize-use-using` to update the syntax to use the newer syntax. - Remove unused functions to make `clang-tidy` happy. - This results in consistency within the codebase.
2020-09-08AK: Add generic SimpleIterator class to replace VectorIterator.asynts
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-08-19NonnullPtrVector: Add ptr_at() getters for accessing the NonnullPtrAndreas Kling
Normally you want to access the T&, but sometimes you need to grab at the NonnullPtr, for example when moving it out of the Vector before a call to remove(). This is generally a weird pattern, but I don't have a better solution at the moment.
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 :^)