Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-17 08:39:51

0001 // Copyright 2025 Joaquin M Lopez Munoz.
0002 // Distributed under the Boost Software License, Version 1.0.
0003 // https://www.boost.org/LICENSE_1_0.txt
0004 
0005 #ifndef BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED
0006 #define BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED
0007 
0008 #include <type_traits>
0009 
0010 namespace boost
0011 {
0012 namespace hash_detail
0013 {
0014 
0015 template<class... Ts> struct make_void
0016 {
0017     using type = void;
0018 };
0019 
0020 template<class... Ts> using void_t = typename make_void<Ts...>::type;
0021 
0022 template<class IsAvalanching> struct avalanching_value
0023 {
0024     static constexpr bool value = IsAvalanching::value;
0025 };
0026 
0027 // may be explicitly marked as BOOST_DEPRECATED in the future
0028 template<> struct avalanching_value<void>
0029 {
0030     static constexpr bool value = true;
0031 };
0032 
0033 template<class Hash, class = void> struct hash_is_avalanching_impl: std::false_type
0034 {
0035 };
0036 
0037 template<class Hash> struct hash_is_avalanching_impl<Hash, void_t<typename Hash::is_avalanching> >:
0038     std::integral_constant<bool, avalanching_value<typename Hash::is_avalanching>::value>
0039 {
0040 };
0041 
0042 template<class Hash>
0043 struct hash_is_avalanching_impl<Hash, typename std::enable_if< ((void)Hash::is_avalanching, true) >::type>
0044 {
0045   // Hash::is_avalanching is not a type: we don't define value to produce
0046   // a compile error downstream
0047 };
0048 
0049 } // namespace hash_detail
0050 
0051 template<class Hash> struct hash_is_avalanching: hash_detail::hash_is_avalanching_impl<Hash>::type
0052 {
0053 };
0054 
0055 } // namespace boost
0056 
0057 #endif // #ifndef BOOST_HASH_HASH_IS_AVALANCHING_HPP_INCLUDED