Extending memcmp optimization to classes
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
With C++20 it's possible to default comparison operators. With has_unique_object_representations and an intrinsic to detect if type is trivially equality comparable (it has defaulted operator== and all of it's members are trivially equality comparable) we could greatly increase number of cases when equal uses memcmp.
It would be great if we could default operator== for types like tuple and pair, but I don't know if we can do that.
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
Start by reading the equal implementation and the C++20 comparison facilities relevant to defaulted operators, has_unique_object_representations, and trivial equality comparability. Investigate whether types such as tuple and pair can safely qualify for memcmp-based equality; done means the supported class cases and implementation direction are clearly established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100