`<flat_map>`, `<flat_set>`: Unify `_Emplace_hint()`
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
<flat_map> and <flat_set> have very different implementations of _Emplace_hint(). They should be unified (not literally into the same function, but into very similar code patterns modulo the key/mapped difference).
There may be ways to further simplify them (I think there's too much special-casing of _IsUnique but I'm not certain).
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.
Research direction
Compare the separate <flat_map> and <flat_set> implementations of _Emplace_hint(), focusing on their differing key/mapped handling and _IsUnique special cases. Determine whether their code patterns can be made similar without changing behavior; done means the implementations are unified as described and the relevant STL tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100