mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 07:24:37 +00:00
Add initializer_list constructor to unordered_map
This commit is contained in:
parent
568f18002a
commit
6ebee99ed1
@ -17,6 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <initializer_list>
|
||||
#include <lock.hpp>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -63,6 +64,16 @@ namespace std
|
||||
umDebug("Created unordered_map with %d buckets", num);
|
||||
}
|
||||
|
||||
unordered_map(std::initializer_list<pair_t> init)
|
||||
: Buckets(16)
|
||||
{
|
||||
umDebug("Created unordered_map with 16 buckets (initializer_list)");
|
||||
for (const auto &p : init)
|
||||
{
|
||||
insert(p);
|
||||
}
|
||||
}
|
||||
|
||||
~unordered_map()
|
||||
{
|
||||
umDebug("Destroyed unordered_map");
|
||||
|
Loading…
x
Reference in New Issue
Block a user