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
Uh oh!
There was an error while loading. Please reload this page.
-
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::combineis what I can find inMixingHashState::CombineContiguousImplandMixingHashState::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 inHashStateorMixingHashStateso I can't check that we arrive atCombineContiguousImplwithout 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 Barthat effectively happens is this, just with extra type stuff which is inlined and erased:Beta Was this translation helpful? Give feedback.
All reactions