]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Merge branch 'Melanosuchus/modernize' into Melanosuchus/cmake
authorMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 26 Jul 2015 09:48:52 +0000 (11:48 +0200)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 26 Jul 2015 09:48:52 +0000 (11:48 +0200)
1  2 
libs/container/hashtable.h

index 0f174d20e87b813d27ac9cd983b161d0ffa54867,1deb231ef09952c37d673de1094e2a5534602bf1..6b16bd60b8091092bf650ffabebea3aed1954a1d
  #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 -244,7 +245,7 @@@ BucketNode* bucket_find( Bucket bucket
                        return 0;
                }
  
-               if ( nodeHash == hash && KeyEqual::operator()( ( *i ).key, key ) ) {
+               if ( nodeHash == hash && KeyEqual::operator()( ( *i ).first, key ) ) {
                        return i.node();
                }
        }
@@@ -409,3 -413,5 +414,5 @@@ void clear()
  };
  
  #endif
+ #endif