#pragma once #include #include template struct FixedClearableHashTableCell { using State = ClearableHashSetState; using value_type = Key; using mapped_type = VoidMapped; UInt32 version; FixedClearableHashTableCell() {} FixedClearableHashTableCell(const Key &, const State & state) : version(state.version) {} const VoidKey getKey() const { return {}; } VoidMapped getMapped() const { return {}; } bool isZero(const State & state) const { return version != state.version; } void setZero() { version = 0; } struct CellExt { Key key; const VoidKey getKey() const { return {}; } VoidMapped getMapped() const { return {}; } const value_type & getValue() const { return key; } void update(Key && key_, FixedClearableHashTableCell *) { key = key_; } }; }; template class FixedClearableHashSet : public FixedHashTable, Allocator> { public: using Base = FixedHashTable, Allocator>; using LookupResult = typename Base::LookupResult; void clear() { ++this->version; this->m_size = 0; } };