summaryrefslogtreecommitdiff
path: root/AK/SinglyLinkedListWithCount.h
AgeCommit message (Collapse)Author
2021-04-22Everywhere: Use bgianf@serenityos.org for my copyright attributionBrian Gianforcaro
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-08Everywhere: Remove unnecessary headers 4/4Ben Wiederhake
Arbitrarily split up to make git bisect easier. These unnecessary #include's were found by combining an automated tool (which determined likely candidates) and some brain power (which decided whether the #include is also semantically superfluous).
2021-01-31SinglyLinkedListWithCount: Correctly pass args to append, insert_before, ↵Lenny Maiorani
insert_after Problem: - Using regular functions rather than function templates results in the arguments not being deduced. This then requires the same function to be written multiple times and for `move` to be used rather than `forward`. Solution: - Collapse multiple function overloads to a single function template with a deduced argument. This allows the argument to be a forwarding reference and bind to either an l-value or r-value and forward the value.
2021-01-12AK: Simplify constructors and conversions from nullptr_tLenny Maiorani
Problem: - Many constructors are defined as `{}` rather than using the ` = default` compiler-provided constructor. - Some types provide an implicit conversion operator from `nullptr_t` instead of requiring the caller to default construct. This violates the C++ Core Guidelines suggestion to declare single-argument constructors explicit (https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c46-by-default-declare-single-argument-constructors-explicit). Solution: - Change default constructors to use the compiler-provided default constructor. - Remove implicit conversion operators from `nullptr_t` and change usage to enforce type consistency without conversion.
2021-01-11SinglyLinkedList: Implement `find` in terms of `AK::find`Lenny Maiorani
Problem: - The implementation of `find` is coupled to the implementation of `SinglyLinkedList`. Solution: - Decouple the implementation of `find` from the class by using a generic `find` algorithm.
2020-11-22AK: Cleanup missing includes and #ifdef evaluationLenny Maiorani
Problem: - Several files have missing includes. This results in complaints from `clang-tidy`. - `#ifdef` is followed by `#elif <value>` which evaluates to `0`. Solution: - Add missing includes. - Change to `#elif defined(<value>)`.
2020-09-25Meta+AK: Make clang-format-10 cleanBen Wiederhake
2020-08-05AK: Add SinglyLinkedListWithCount<T>, a singulary linked list with countBrian Gianforcaro
There are use cases where a linked list is useful but it's also worth the overhead to maintain a count so you can quickly answer queries of the size of the list.