Using a hashmap

From LPTMS Wiki
Revision as of 08:40, 8 April 2011 by Roux (talk | contribs) (Created page with "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"> #ifdef __GNUC__ #if __...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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>