pool: add emplace() function
authorEddie Hung <eddie@fpgeh.com>
Wed, 22 Apr 2020 15:14:07 +0000 (08:14 -0700)
committerEddie Hung <eddie@fpgeh.com>
Wed, 22 Apr 2020 15:14:07 +0000 (08:14 -0700)
kernel/hashlib.h

index ad2ed60339adc25c008ac17d7037c05fe2e17c8f..ba224191c4302ee7ad67c0c0e9c85c99ce2791f0 100644 (file)
@@ -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);