]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/container/hashtable.h
Merge branch 'Melanosuchus/modernize' into Melanosuchus/cmake
[xonotic/netradiant.git] / libs / container / hashtable.h
index 0f174d20e87b813d27ac9cd983b161d0ffa54867..6b16bd60b8091092bf650ffabebea3aed1954a1d 100644 (file)
 #if !defined( INCLUDED_CONTAINER_HASHTABLE_H )
 #define INCLUDED_CONTAINER_HASHTABLE_H
 
+#include <unordered_map>
+
+template<typename Key, typename Value, typename Hasher, typename KeyEqual = std::equal_to<Key> >
+       using HashTable = std::unordered_map<Key, Value, Hasher, KeyEqual>;
+
+#if 0
 #include <cstddef>
 #include <algorithm>
 #include <functional>
 #include <memory>
 #include "debugging/debugging.h"
 
-
 namespace HashTableDetail
 {
 inline std::size_t next_power_of_two( std::size_t size ){
@@ -240,7 +245,7 @@ BucketNode* bucket_find( Bucket bucket, hash_type hash, const Key& key ){
                        return 0;
                }
 
-               if ( nodeHash == hash && KeyEqual::operator()( ( *i ).key, key ) ) {
+               if ( nodeHash == hash && KeyEqual::operator()( ( *i ).first, key ) ) {
                        return i.node();
                }
        }
@@ -409,3 +414,5 @@ void clear(){
 };
 
 #endif
+
+#endif