Using a hashmap: Difference between revisions

From LPTMS Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
== with BOOST ==
== with BOOST ==
*[http://www.boost.org/doc/libs/1_45_0/doc/html/unordered.html unordered]
*[http://www.boost.org/doc/libs/1_45_0/doc/html/unordered.html unordered]
== With SparseHash ==
*[http://code.google.com/p/sparsehash/ SparseHash]


== with GCC ==
== with GCC ==

Latest revision as of 11:28, 17 October 2013

with BOOST

With SparseHash

with GCC

A header to use the hash_map<Key,Type> (same member functions/objects as a std::map<Key,Type>) which is not in the stl library: <source lang="cpp">

  1. ifdef __GNUC__
       #if __GNUC__ < 3
               #include <hash_map>
       #else
               #include <ext/hash_map>
               #if __GNUC_MINOR__ == 0
                       using namespace std;       // GCC 3.0                                                                                          
               #else
                       using namespace __gnu_cxx; // GCC >= 3.1                                                                                  
               #endif
       #endif
  1. endif

</source>