Closed joaquintides closed 3 months ago
I'm not sure that we need to support anything other than void
for backward compatibility as that's what's presently used and documented everywhere. Silently accepting any type and treating it as true makes it way too easy to introduce errors.
I think what we want is: hash_is_avalanching<H>
is
std::true_type
when std::is_void<H::is_avalanching>::value
is true
std::integral_constant<bool, H::is_avalanching::value>
in the case H::is_avalanching
exists, of course.
This accepts boost::integral_constant<bool, B>
and other non-std
integral constants such as mpl::bool_
.
Currently, hash function avalanching is indicated by the mere presence of a nested
is_avalanching
typedef (likeis_transparent
). Change that to requiring thatis_avalanching
isstd::[true|false]_type
(or derived from those), in the same vein as propagate traits for allocators.To keep backwards compatiblity, if
is_avalanching
is present but not (derived from)std::[true|false]_type
, this must be taken as equivalent tousing is_avalanching = std::true_type
.