@@ -96,6 +96,7 @@ template <typename TKey, typename TValue, unsigned kNumInlineItems = 1, typename
9696 : m_key(std::move(other))
9797 {
9898 }
99+
99100 [[nodiscard]] inline bool isValid () const noexcept { return TKeyInfo::isValid (m_key); }
100101 [[nodiscard]] inline bool isEmpty () const noexcept { return TKeyInfo::isEqual (TKeyInfo::getEmpty (), m_key); }
101102 [[nodiscard]] inline bool isTombstone () const noexcept { return TKeyInfo::isEqual (TKeyInfo::getTombstone (), m_key); }
@@ -739,7 +740,7 @@ template <typename TKey, typename TValue, unsigned kNumInlineItems = 1, typename
739740 // i.e.
740741 // auto it = table.find("key");
741742 // table.emplace("another_key", it->second); // <--- when hash table grows it->second will point to a memory we are about to free
742- std::pair<IteratorKV, bool > it = emplaceToExisting (size_t (numBucketsNew), key, args...);
743+ std::pair<IteratorKV, bool > it = emplaceToExisting (size_t (numBucketsNew), std::forward<TK>( key), std::forward<Args>( args) ...);
743744
744745 reinsert (size_t (numBucketsNew), item, enditem);
745746
@@ -766,9 +767,9 @@ template <typename TKey, typename TValue, unsigned kNumInlineItems = 1, typename
766767 const uint32_t numBucketsThreshold = shr (numBuckets, 1u ) + 1 ;
767768 if (EXLBR_LIKELY (m_numElements < numBucketsThreshold))
768769 {
769- return emplaceToExisting (numBuckets, key, args...);
770+ return emplaceToExisting (numBuckets, std::forward<TK>( key), std::forward<Args>( args) ...);
770771 }
771- return emplaceReallocate (std::max (numBuckets * 2 , 64u ), key, args...);
772+ return emplaceReallocate (std::max (numBuckets * 2 , 64u ), std::forward<TK>( key), std::forward<Args>( args) ...);
772773 }
773774
774775 [[nodiscard]] inline ConstIteratorKV find (const TKey& key) const noexcept
0 commit comments