From: Eddie Hung Date: Wed, 22 Apr 2020 15:14:07 +0000 (-0700) Subject: pool: add emplace() function X-Git-Tag: working-ls180~598^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7c66fdc61508017113a93b51ea79827fb67adfc;p=yosys.git pool: add emplace() function --- 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(this, i), true); } + template + std::pair emplace(Args&&... args) + { + return insert(K(std::forward(args)...)); + } + int erase(const K &key) { int hash = do_hash(key);