Go to the documentation of this file.00001 #ifndef OPENTISSUE_CORE_CONTAINERS_CONTAINERS_HASH_MAP_H
00002 #define OPENTISSUE_CORE_CONTAINERS_CONTAINERS_HASH_MAP_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012
00013
00014
00015
00016 #ifdef __GNUC__
00017 # if __GNUC__ < 3
00018 # include <hash_map.h>
00019 namespace stdext { using ::hash_map; };
00020 # else
00021 # include <ext/hash_map>
00022 # if (__GNUC__ == 3 && __GNUC_MINOR__ == 0)
00023 namespace stdext = std;
00024 # else
00025 # include <cstddef>
00026 # include <locale>
00027 # include <string>
00028 namespace __gnu_cxx
00029 {
00030 template< typename CharT, typename Traits, typename Alloc >
00031 struct hash< const std::basic_string<CharT, Traits, Alloc> >
00032 {
00033 std::size_t operator()(const std::basic_string<CharT, Traits, Alloc>& s) const
00034 {
00035 const std::collate<CharT>& c = std::use_facet<std::collate<CharT> >(std::locale());
00036 return c.hash(s.c_str(), s.c_str() + s.length());
00037 }
00038 };
00039
00040 template< typename CharT, typename Traits, typename Alloc >
00041 struct hash< std::basic_string<CharT, Traits, Alloc> >
00042 : hash< const std::basic_string<CharT, Traits, Alloc> > {};
00043 }
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 namespace stdext = __gnu_cxx;
00056 # endif
00057 # endif
00058 #else // ... there are other compilers, right?
00059 # include <hash_map>
00060
00061 #endif
00062
00063
00064 #endif