Hashable should take type index into account
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start in include/mapbox/variant.hpp at lines 1002-1011 and 536-544, where variant hashing and type-index access are referenced. Ensure the hash accounts for both the underlying value hash and .which() so variants with equal value hashes but different type indexes do not collide.
Written by the indexing model from the issue text.
Description
Hashing a variant should take the type index / .which() into account in addition to the underlying hash
- https://github.com/mapbox/variant/blob/02bd1ac4c07e6db9fe0f01267853e43b41637b74/include/mapbox/variant.hpp#L1002-L1011
- https://github.com/mapbox/variant/blob/02bd1ac4c07e6db9fe0f01267853e43b41637b74/include/mapbox/variant.hpp#L536-L544
Why? Because of the edge case where the underlying hash is the same but the type index is not.
- Dominant language
- C++
- Stars
- 384
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/variant
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·