#pragma once #include #include template < typename Key, typename Cell, typename Hash = DefaultHash, typename Grower = TwoLevelHashTableGrower<>, typename Allocator = HashTableAllocator > class TwoLevelHashMapTable : public TwoLevelHashTable> { public: using key_type = Key; using mapped_type = typename Cell::Mapped; using value_type = typename Cell::value_type; using TwoLevelHashTable >::TwoLevelHashTable; mapped_type & ALWAYS_INLINE operator[](Key x) { typename TwoLevelHashMapTable::iterator it; bool inserted; this->emplace(x, it, inserted); if (inserted) new(&it->second) mapped_type(); return it->second; } }; template < typename Key, typename Mapped, typename Hash = DefaultHash, typename Grower = TwoLevelHashTableGrower<>, typename Allocator = HashTableAllocator > using TwoLevelHashMap = TwoLevelHashMapTable, Hash, Grower, Allocator>; template < typename Key, typename Mapped, typename Hash = DefaultHash, typename Grower = TwoLevelHashTableGrower<>, typename Allocator = HashTableAllocator > using TwoLevelHashMapWithSavedHash = TwoLevelHashMapTable, Hash, Grower, Allocator>;