epoc32/include/stdapis/stlport/stl/_hash_fun.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/stdapis/stlport/stl/_hash_fun.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/stdapis/stlport/stl/_hash_fun.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,107 @@
     1.4 -_hash_fun.h
     1.5 +/*
     1.6 + * Copyright (c) 1996-1998
     1.7 + * Silicon Graphics Computer Systems, Inc.
     1.8 + *
     1.9 + * Permission to use, copy, modify, distribute and sell this software
    1.10 + * and its documentation for any purpose is hereby granted without fee,
    1.11 + * provided that the above copyright notice appear in all copies and
    1.12 + * that both that copyright notice and this permission notice appear
    1.13 + * in supporting documentation.  Silicon Graphics makes no
    1.14 + * representations about the suitability of this software for any
    1.15 + * purpose.  It is provided "as is" without express or implied warranty.
    1.16 + *
    1.17 + *
    1.18 + * Copyright (c) 1994
    1.19 + * Hewlett-Packard Company
    1.20 + *
    1.21 + * Permission to use, copy, modify, distribute and sell this software
    1.22 + * and its documentation for any purpose is hereby granted without fee,
    1.23 + * provided that the above copyright notice appear in all copies and
    1.24 + * that both that copyright notice and this permission notice appear
    1.25 + * in supporting documentation.  Hewlett-Packard Company makes no
    1.26 + * representations about the suitability of this software for any
    1.27 + * purpose.  It is provided "as is" without express or implied warranty.
    1.28 + *
    1.29 + */
    1.30 +
    1.31 +/* NOTE: This is an internal header file, included by other STL headers.
    1.32 + *   You should not attempt to use it directly.
    1.33 + */
    1.34 +
    1.35 +#ifndef _STLP_HASH_FUN_H
    1.36 +#define _STLP_HASH_FUN_H
    1.37 +
    1.38 +# ifndef _STLP_CSTDDEF
    1.39 +#  include <cstddef>
    1.40 +# endif
    1.41 +
    1.42 +_STLP_BEGIN_NAMESPACE
    1.43 +
    1.44 +template <class _Key> struct hash { };
    1.45 +
    1.46 +inline size_t __stl_hash_string(const char* __s)
    1.47 +{
    1.48 +  _STLP_FIX_LITERAL_BUG(__s)
    1.49 +  unsigned long __h = 0; 
    1.50 +  for ( ; *__s; ++__s)
    1.51 +    __h = 5*__h + *__s;
    1.52 +  
    1.53 +  return size_t(__h);
    1.54 +}
    1.55 +
    1.56 +_STLP_TEMPLATE_NULL struct hash<char*>
    1.57 +{
    1.58 +  size_t operator()(const char* __s) const { _STLP_FIX_LITERAL_BUG(__s) return __stl_hash_string(__s); }
    1.59 +};
    1.60 +
    1.61 +_STLP_TEMPLATE_NULL struct hash<const char*>
    1.62 +{
    1.63 +  size_t operator()(const char* __s) const { _STLP_FIX_LITERAL_BUG(__s) return __stl_hash_string(__s); }
    1.64 +};
    1.65 +
    1.66 +_STLP_TEMPLATE_NULL struct hash<char> {
    1.67 +  size_t operator()(char __x) const { return __x; }
    1.68 +};
    1.69 +_STLP_TEMPLATE_NULL struct hash<unsigned char> {
    1.70 +  size_t operator()(unsigned char __x) const { return __x; }
    1.71 +};
    1.72 +#ifndef _STLP_NO_SIGNED_BUILTINS
    1.73 +_STLP_TEMPLATE_NULL struct hash<signed char> {
    1.74 +  size_t operator()(unsigned char __x) const { return __x; }
    1.75 +};
    1.76 +#endif
    1.77 +_STLP_TEMPLATE_NULL struct hash<short> {
    1.78 +  size_t operator()(short __x) const { return __x; }
    1.79 +};
    1.80 +_STLP_TEMPLATE_NULL struct hash<unsigned short> {
    1.81 +  size_t operator()(unsigned short __x) const { return __x; }
    1.82 +};
    1.83 +_STLP_TEMPLATE_NULL struct hash<int> {
    1.84 +  size_t operator()(int __x) const { return __x; }
    1.85 +};
    1.86 +_STLP_TEMPLATE_NULL struct hash<unsigned int> {
    1.87 +  size_t operator()(unsigned int __x) const { return __x; }
    1.88 +};
    1.89 +_STLP_TEMPLATE_NULL struct hash<long> {
    1.90 +  size_t operator()(long __x) const { return __x; }
    1.91 +};
    1.92 +_STLP_TEMPLATE_NULL struct hash<unsigned long> {
    1.93 +  size_t operator()(unsigned long __x) const { return __x; }
    1.94 +};
    1.95 +
    1.96 +# if defined (_STLP_LONG_LONG)
    1.97 +_STLP_TEMPLATE_NULL struct hash<_STLP_LONG_LONG> {
    1.98 +  size_t operator()(long x) const { return x; }
    1.99 +};
   1.100 +_STLP_TEMPLATE_NULL struct hash<unsigned _STLP_LONG_LONG> {
   1.101 +  size_t operator()(unsigned long x) const { return x; }
   1.102 +};
   1.103 +# endif
   1.104 +
   1.105 +_STLP_END_NAMESPACE
   1.106 +
   1.107 +#endif /* _STLP_HASH_FUN_H */
   1.108 +
   1.109 +// Local Variables:
   1.110 +// mode:C++
   1.111 +// End: