57#ifndef LIB_HASH_STANDARD_H
58#define LIB_HASH_STANDARD_H
59#ifdef _FUNCTIONAL_HASH_H
60#error "unable to hijack std::hash, since <bits/functional_hash.hpp> has already been included. \
61 Please ensure that lib/hash_standard.hpp is included first, before including <string> or <functional>"
99 template<
typename Result,
typename Arg>
103 template<
typename TY,
typename TOGGLE =
void>
107 static_assert (
sizeof(TY) < 0,
"No hash implementation found. "
108 "Either specialise std::hash or provide a boost-style hash_value via ADL.");
118 template<
typename TY>
123 operator() (TY
const& elm)
const noexcept
125 return hash_value(elm);
138 template<
typename TY>
150#define hash hash_HIDDEN
151#define _Hash_impl _Hash_impl_HIDDEN
152#include <bits/c++config.h>
153#include <bits/functional_hash.h>
169 :
public std::_Hash_impl_HIDDEN
171 template<
typename ... ARGS>
173 hash (ARGS&&... args) ->
decltype(hash_HIDDEN (std::forward<ARGS>(args)...))
175 return hash_HIDDEN (std::forward<ARGS>(args)...);
184#define STD_HASH_IMPL(_TY_) \
185 template<> struct hash<_TY_> : public hash_HIDDEN<_TY_> { };
#define STD_HASH_IMPL(_TY_)
Hash value types and utilities.
Implementation namespace for support and library code.
static auto hash(ARGS &&... args) -> decltype(hash_HIDDEN(std::forward< ARGS >(args)...))
Primary class template for std::hash.