1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +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:
Hediadyoin1 2021-06-13 16:26:08 +02:00 committed by Andreas Kling
parent c69ea44397
commit 4a81c79909
3 changed files with 136 additions and 26 deletions

View file

@ -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;