hash_traits.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /* Hash function characterization.
  2. *
  3. * Copyright 2022 Joaquin M Lopez Munoz.
  4. * Distributed under the Boost Software License, Version 1.0.
  5. * (See accompanying file LICENSE_1_0.txt or copy at
  6. * http://www.boost.org/LICENSE_1_0.txt)
  7. *
  8. * See https://www.boost.org/libs/unordered for library home page.
  9. */
  10. #ifndef BOOST_UNORDERED_HASH_TRAITS_HPP
  11. #define BOOST_UNORDERED_HASH_TRAITS_HPP
  12. #include <boost/unordered/detail/type_traits.hpp>
  13. namespace boost{
  14. namespace unordered{
  15. namespace detail{
  16. template<typename Hash,typename=void>
  17. struct hash_is_avalanching_impl: std::false_type{};
  18. template<typename Hash>
  19. struct hash_is_avalanching_impl<Hash,
  20. boost::unordered::detail::void_t<typename Hash::is_avalanching> >:
  21. std::true_type{};
  22. } /* namespace detail */
  23. /* Each trait can be partially specialized by users for concrete hash functions
  24. * when actual characterization differs from default.
  25. */
  26. /* hash_is_avalanching<Hash>::value is true when the type Hash::is_avalanching
  27. * is present, false otherwise.
  28. */
  29. template<typename Hash>
  30. struct hash_is_avalanching: detail::hash_is_avalanching_impl<Hash>::type{};
  31. } /* namespace unordered */
  32. } /* namespace boost */
  33. #endif