xref: /aoo42x/main/stlport/systemstl/hash_map (revision e76eebc6)
1*e76eebc6SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*e76eebc6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*e76eebc6SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*e76eebc6SAndrew Rist * distributed with this work for additional information
6*e76eebc6SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*e76eebc6SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*e76eebc6SAndrew Rist * "License"); you may not use this file except in compliance
9*e76eebc6SAndrew Rist * with the License.  You may obtain a copy of the License at
10*e76eebc6SAndrew Rist *
11*e76eebc6SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*e76eebc6SAndrew Rist *
13*e76eebc6SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*e76eebc6SAndrew Rist * software distributed under the License is distributed on an
15*e76eebc6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*e76eebc6SAndrew Rist * KIND, either express or implied.  See the License for the
17*e76eebc6SAndrew Rist * specific language governing permissions and limitations
18*e76eebc6SAndrew Rist * under the License.
19*e76eebc6SAndrew Rist *
20*e76eebc6SAndrew Rist *************************************************************/
21cdf0e10cSrcweir
22cdf0e10cSrcweir#ifndef SYSTEM_STL_HASHMAP
23cdf0e10cSrcweir#define SYSTEM_STL_HASHMAP
24cdf0e10cSrcweir
25cdf0e10cSrcweir#ifdef GCC
26cdf0e10cSrcweir
27cdf0e10cSrcweir# include <functional>
28cdf0e10cSrcweir
29cdf0e10cSrcweir# define _BACKWARD_BACKWARD_WARNING_H 1
30cdf0e10cSrcweir# include <ext/hash_map>
31cdf0e10cSrcweir# undef _BACKWARD_BACKWARD_WARNING_H
32cdf0e10cSrcweir
33cdf0e10cSrcweirnamespace __gnu_cxx
34cdf0e10cSrcweir{
35cdf0e10cSrcweir    template<> struct hash < std::string >
36cdf0e10cSrcweir    {
37cdf0e10cSrcweir        size_t operator()(const std::string & x) const
38cdf0e10cSrcweir        {
39cdf0e10cSrcweir            return hash< const char* >()(x.c_str());
40cdf0e10cSrcweir        }
41cdf0e10cSrcweir    };
42cdf0e10cSrcweir
43cdf0e10cSrcweir    template<> struct hash< long long int >
44cdf0e10cSrcweir    {
45cdf0e10cSrcweir        size_t operator()(long long int __x) const
46cdf0e10cSrcweir        {
47cdf0e10cSrcweir            return __x;
48cdf0e10cSrcweir        }
49cdf0e10cSrcweir    };
50cdf0e10cSrcweir
51cdf0e10cSrcweir    template<> struct hash< unsigned long long int >
52cdf0e10cSrcweir    {
53cdf0e10cSrcweir        size_t operator()(unsigned long long int __x) const
54cdf0e10cSrcweir        {
55cdf0e10cSrcweir            return __x;
56cdf0e10cSrcweir        }
57cdf0e10cSrcweir    };
58cdf0e10cSrcweir}
59cdf0e10cSrcweir
60cdf0e10cSrcweirnamespace std
61cdf0e10cSrcweir{
62cdf0e10cSrcweir# ifndef __GXX_EXPERIMENTAL_CXX0X__
63cdf0e10cSrcweir	using __gnu_cxx::hash;
64cdf0e10cSrcweir# endif
65cdf0e10cSrcweir	using __gnu_cxx::hash_map;
66cdf0e10cSrcweir	using __gnu_cxx::hash_multimap;
67cdf0e10cSrcweir}
68cdf0e10cSrcweir
69cdf0e10cSrcweir#else
70cdf0e10cSrcweir# error UNSUPPORTED COMPILER
71cdf0e10cSrcweir#endif
72cdf0e10cSrcweir
73cdf0e10cSrcweir
74cdf0e10cSrcweir#endif
75cdf0e10cSrcweir/* vi:set tabstop=4 shiftwidth=4 expandtab: */
76