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:
parent
c69ea44397
commit
4a81c79909
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