#include <cstddef>
#include <string>
#include <cmath>
#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <functional>
# define _GLIBCXX_BEGIN_NAMESPACE_TR1
# define _GLIBCXX_END_NAMESPACE_TR1
#else
#include <tr1/functional>
# define _GLIBCXX_BEGIN_NAMESPACE_TR1 namespace tr1 {
# define _GLIBCXX_END_NAMESPACE_TR1 }
#endif
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE_TR1
template<>
size_t
hash<long double>::operator()(long double __val) const
{
size_t __result = 0;
int __exponent;
__val = std::frexp(__val, &__exponent);
__val = __val < 0.0l ? -(__val + 0.5l) : __val;
const long double __mult =
__gnu_cxx::__numeric_traits<size_t>::__max + 1.0l;
__val *= __mult;
const size_t __hibits = (size_t)__val;
__val = (__val - (long double)__hibits) * __mult;
const size_t __coeff =
__gnu_cxx::__numeric_traits<size_t>::__max / __LDBL_MAX_EXP__;
__result = __hibits + (size_t)__val + __coeff * __exponent;
return __result;
};
#ifndef _GLIBCXX_LONG_DOUBLE_COMPAT_IMPL
template<>
size_t
hash<string>::operator()(string __s) const
{ return _Fnv_hash<>::hash(__s.data(), __s.length()); }
template<>
size_t
hash<const string&>::operator()(const string& __s) const
{ return _Fnv_hash<>::hash(__s.data(), __s.length()); }
#ifdef _GLIBCXX_USE_WCHAR_T
template<>
size_t
hash<wstring>::operator()(wstring __s) const
{
const char* __p = reinterpret_cast<const char*>(__s.data());
return _Fnv_hash<>::hash(__p, __s.length() * sizeof(wchar_t));
}
template<>
size_t
hash<const wstring&>::operator()(const wstring& __s) const
{
const char* __p = reinterpret_cast<const char*>(__s.data());
return _Fnv_hash<>::hash(__p, __s.length() * sizeof(wchar_t));
}
#endif
#endif
_GLIBCXX_END_NAMESPACE_TR1
}