nodejs / nodejs/node-addon-api
Adopt C++20 defaulted comparisons (operator== / <=>)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 499
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 2
Description
Several node-addon-api types define operator== and operator!= as an explicit pair, where the != is always return !operator==(other);. In C++20 the compiler synthesizes a != b from operator==, so the hand-written != overloads become redundant and can be removed. Where the comparison is plain memberwise equality, operator== itself can be = defaulted.
Regarding <=>, the only plausible type is Maybe<T> where T is ordered.
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
Locate the node-addon-api types that define explicit operator== and operator!= pairs, then inspect Maybe for ordered comparisons. Confirm which equality operators are plain memberwise comparisons and which T types are ordered. Done means redundant != overloads are removed and eligible == or <=> operators are defaulted without changing comparison behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100