H::combine implementation details #1781
Unanswered
widlarizer
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to understand abseil's hashing infrastructure not to abuse its internal implementation but to partially replicate it. What I'd like to know is if all the "magic" in
H::combine
is what I can find inMixingHashState::CombineContiguousImpl
andMixingHashState::Mix
, but I'm only seeing a forward declaration of aHashStateBase::combine(H state, const T& value, const Ts&... values)
inHashStateBase
. I don't see a definition inHashState
orMixingHashState
so I can't check that we arrive atCombineContiguousImpl
without doing any other intermediate steps. I'm interested in what exactly happens if I were to hash nested records of typically small (word-sized) members. Ifstruct Foo = { int a; int b; }; struct Bar = {char x; Foo y; bool z; };
, I would like to confirm, that the computation of hash of astruct Bar
that effectively happens is this, just with extra type stuff which is inlined and erased:Beta Was this translation helpful? Give feedback.
All reactions