From a7c66fdc61508017113a93b51ea79827fb67adfc Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 22 Apr 2020 08:14:07 -0700 Subject: [PATCH] pool: add emplace() function --- kernel/hashlib.h | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.30.2