{{ message }}
Tags: martinus/unordered_dense
Tags
Ask the trait everywhere the marker is read
Cleanup pass over the two commits below.
The std::hash fallback was still reading std::hash<T>::is_avalanching itself,
which left two readers of the marker where the point of the change was to have
one -- and the second understood only the `= void` spelling. A std::hash marked
the way Boost asks, or one named avalanching by a specialization because it
cannot be edited, did not reach the table: both answered no. Both now answer
yes, and there are tests that fail without the fix.
Making the fallback ask meant the trait had to be defined above it, so the
detection machinery it needs moved up with it, next to the hashes rather than
several hundred lines below them.
The four-way reading of the marker is now one constexpr function rather than
five class templates, which also gives it somewhere to say the other thing a
reader gets wrong:
static constexpr bool is_avalanching = true; // a value, not a type
which used to answer "not avalanching" and say nothing about why.
require_avalanching says what it means when the hash is final rather than
letting the error come from the base class list, and takes a stateful hash by
value as well as braced. Its README paragraph claimed the check survives the
hash being "swapped for another"; it survives my_hash being reimplemented
without its marker, which is not the same thing and is what it now says.
custom_hash's static_asserts asked the private detector; they ask the trait
now, which is the contract and is what would have caught the fallback.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CxhyeMXim7Pvb8SmYoEdBk
PreviousNext
