42#ifndef PB_DS_HASH_EQ_FN_HPP
43#define PB_DS_HASH_EQ_FN_HPP
54 template<
typename Key,
typename Eq_Fn,
typename _Alloc,
bool Store_Hash>
58 template<
typename Key,
typename Eq_Fn,
typename _Alloc>
59 struct hash_eq_fn<Key, Eq_Fn, _Alloc, false> :
public Eq_Fn
61 typedef Eq_Fn eq_fn_base;
62 typedef typename rebind_traits<_Alloc, Key>::const_reference
67 hash_eq_fn(
const Eq_Fn& r_eq_fn) : Eq_Fn(r_eq_fn) { }
70 operator()(key_const_reference r_lhs_key,
71 key_const_reference r_rhs_key)
const
72 {
return eq_fn_base::operator()(r_lhs_key, r_rhs_key); }
76 {
std::swap((Eq_Fn&)(*
this), (Eq_Fn&)other); }
81 template<
typename Key,
class Eq_Fn,
class _Alloc>
82 struct hash_eq_fn<Key, Eq_Fn, _Alloc, true> :
public Eq_Fn
84 typedef typename _Alloc::size_type size_type;
85 typedef Eq_Fn eq_fn_base;
86 typedef typename rebind_traits<_Alloc, Key>::const_reference
91 hash_eq_fn(
const Eq_Fn& r_eq_fn) : Eq_Fn(r_eq_fn) { }
94 operator()(key_const_reference r_lhs_key, size_type lhs_hash,
95 key_const_reference r_rhs_key, size_type rhs_hash)
const
97 _GLIBCXX_DEBUG_ASSERT(!eq_fn_base::operator()(r_lhs_key, r_rhs_key)
98 || lhs_hash == rhs_hash);
100 return (lhs_hash == rhs_hash &&
101 eq_fn_base::operator()(r_lhs_key, r_rhs_key));
106 {
std::swap((Eq_Fn&)(*
this), (Eq_Fn&)(other)); }
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
GNU extensions for policy-based data structures for public use.