diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-04-22 08:14:07 -0700 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2020-04-22 08:14:07 -0700 |
commit | a7c66fdc61508017113a93b51ea79827fb67adfc (patch) | |
tree | 26744241b733dc849fae3120955e4c290a1b353e /kernel/hashlib.h | |
parent | 746c29b1716b7eac4f4be0eded64e7aa05a6682d (diff) | |
download | yosys-a7c66fdc61508017113a93b51ea79827fb67adfc.tar.gz yosys-a7c66fdc61508017113a93b51ea79827fb67adfc.tar.bz2 yosys-a7c66fdc61508017113a93b51ea79827fb67adfc.zip |
pool: add emplace() function
Diffstat (limited to 'kernel/hashlib.h')
-rw-r--r-- | kernel/hashlib.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/hashlib.h b/kernel/hashlib.h index ad2ed6033..ba224191c 100644 --- a/kernel/hashlib.h +++ b/kernel/hashlib.h @@ -871,6 +871,12 @@ public: return std::pair<iterator, bool>(iterator(this, i), true); } + template<typename... Args> + std::pair<iterator, bool> emplace(Args&&... args) + { + return insert(K(std::forward<Args>(args)...)); + } + int erase(const K &key) { int hash = do_hash(key); |