#pragma once #include #include template typename ImplTable = StringHashMap> class TwoLevelStringHashMap : public TwoLevelStringHashTable, ImplTable> { public: using Key = StringRef; using Self = TwoLevelStringHashMap; using Base = TwoLevelStringHashTable, StringHashMap>; using LookupResult = typename Base::LookupResult; using Base::Base; template void ALWAYS_INLINE forEachMapped(Func && func) { for (auto i = 0u; i < this->NUM_BUCKETS; ++i) return this->impls[i].forEachMapped(func); } TMapped & ALWAYS_INLINE operator[](const Key & x) { bool inserted; LookupResult it; this->emplace(x, it, inserted); if (inserted) new (&it->getMapped()) TMapped(); return it->getMapped(); } };