dropped hash_traits in favor of individual traits

This commit is contained in:
joaquintides
2022-10-09 11:23:15 +02:00
parent 32a7ed74e8
commit 3fbaf21b8c
2 changed files with 9 additions and 12 deletions

View File

@ -843,7 +843,7 @@ table:empty_value<Hash,0>,empty_value<Pred,1>,empty_value<Allocator,1>
using size_policy=pow2_size_policy; using size_policy=pow2_size_policy;
using prober=pow2_quadratic_prober; using prober=pow2_quadratic_prober;
using mix_policy=typename std::conditional< using mix_policy=typename std::conditional<
hash_traits<Hash>::is_avalanching::value, hash_is_avalanching<Hash>::value,
no_mix, no_mix,
xmx_mix xmx_mix
>::type; >::type;

View File

@ -20,31 +20,28 @@ namespace unordered{
namespace detail{ namespace detail{
template<typename Hash,typename=void> template<typename Hash,typename=void>
struct hash_is_avalanching struct hash_is_avalanching_impl
{ {
using type=std::false_type; using type=std::false_type;
}; };
template<typename Hash> template<typename Hash>
struct hash_is_avalanching<Hash,void_t<typename Hash::is_avalanching>> struct hash_is_avalanching_impl<Hash,void_t<typename Hash::is_avalanching>>
{ {
using type=std::true_type; using type=std::true_type;
}; };
} /* namespace detail */ } /* namespace detail */
/* Partially specializable by users for concrete hash functions when /* Each trait can be partially specialized by users for concrete hash functions
* actual characterization differs from default. * when actual characterization differs from default.
*/ */
/* Derived from std::true_type if the type Hash::is_avalanching is present,
* derived from std::false_type otherwise.
*/
template<typename Hash> template<typename Hash>
struct hash_traits struct hash_is_avalanching:detail::hash_is_avalanching_impl<Hash>::type{};
{
/* std::true_type if the type Hash::is_avalanching is present,
* std::false_type otherwise.
*/
using is_avalanching=typename detail::hash_is_avalanching<Hash>::type;
};
} /* namespace unordered */ } /* namespace unordered */
} /* namespace boost */ } /* namespace boost */