mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 18:28:57 +00:00
AK: Add Ordering support to HashTable and HashMap
Adds a IsOrdered flag to Hashtable and HashMap, which allows iteration in insertion order
This commit is contained in:
parent
c69ea44397
commit
4a81c79909
Notes:
sideshowbarker
2024-07-18 12:13:01 +09:00
Author: https://github.com/Hendiadyoin1
Commit: 4a81c79909
Pull-request: https://github.com/SerenityOS/serenity/pull/8041
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
3 changed files with 136 additions and 26 deletions
10
AK/Forward.h
10
AK/Forward.h
|
@ -72,12 +72,18 @@ class CircularQueue;
|
|||
template<typename T>
|
||||
struct Traits;
|
||||
|
||||
template<typename T, typename = Traits<T>>
|
||||
template<typename T, typename TraitsForT = Traits<T>, bool IsOrdered = false>
|
||||
class HashTable;
|
||||
|
||||
template<typename K, typename V, typename = Traits<K>>
|
||||
template<typename T, typename TraitsForT = Traits<T>>
|
||||
using OrderedHashTable = HashTable<T, TraitsForT, true>;
|
||||
|
||||
template<typename K, typename V, typename KeyTraits = Traits<K>, bool IsOrdered = false>
|
||||
class HashMap;
|
||||
|
||||
template<typename K, typename V, typename KeyTraits>
|
||||
using OrderedHashMap = HashMap<K, V, KeyTraits, true>;
|
||||
|
||||
template<typename T>
|
||||
class Badge;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue