#pragma once #include "../external/google/sparsehash/dense_hash_map.h" #include "KeyWrapper.h" template, class Alloc = std::allocator, T> > > class Il2CppHashMap : public dense_hash_map, T, HashFcn, typename KeyWrapper::template EqualsComparer, Alloc> { private: typedef dense_hash_map, T, HashFcn, typename KeyWrapper::template EqualsComparer, Alloc> Base; public: typedef typename Base::size_type size_type; typedef typename Base::hasher hasher; typedef typename Base::key_equal key_equal; typedef typename Base::key_type key_type; explicit Il2CppHashMap(size_type n = 0, const hasher& hf = hasher(), const EqualKey& eql = EqualKey()) : Base(n, hf, key_equal(eql)) { Base::set_empty_key(key_type(key_type::KeyType_Empty)); Base::set_deleted_key(key_type(key_type::KeyType_Deleted)); } template Il2CppHashMap(InputIterator f, InputIterator l, size_type n = 0, const hasher& hf = hasher(), const EqualKey& eql = EqualKey()) : Base(f, l, n, hf, key_equal(eql)) { Base::set_empty_key(key_type(key_type::KeyType_Empty)); Base::set_deleted_key(key_type(key_type::KeyType_Deleted)); } void add(const key_type& key, const T& value) { Base::insert(std::make_pair(key, value)); } };