Skip to content

Commit 2f91aeb

Browse files
committed
fix clang/gcc
1 parent b22aee3 commit 2f91aeb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ExcaliburHash/ExcaliburHash.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,12 @@ template <typename TKey, typename TValue, typename TKeyInfo = KeyInfo<TKey>> cla
436436
public:
437437
IteratorBase() = delete;
438438

439+
IteratorBase(const IteratorBase& other) noexcept
440+
: m_ht(other.m_ht)
441+
, m_item(other.m_item)
442+
{
443+
}
444+
439445
IteratorBase(const HashTable* ht, TItem* item) noexcept
440446
: m_ht(ht)
441447
, m_item(item)
@@ -542,9 +548,16 @@ template <typename TKey, typename TValue, typename TKeyInfo = KeyInfo<TKey>> cla
542548
public:
543549
TIteratorKV() = delete;
544550

551+
TIteratorKV(const TIteratorKV& other)
552+
: IteratorBase(other)
553+
, tmpKv(reference<const TKey>(nullptr), reference<TIteratorValue>(nullptr))
554+
{
555+
}
556+
545557
TIteratorKV& operator=(const TIteratorKV& other) noexcept
546558
{
547559
IteratorBase::copyFrom(other);
560+
// note: we'll automatically update tmpKv on the next access = no need to copy
548561
return *this;
549562
}
550563

0 commit comments

Comments
 (0)