nodejs / nodejs/node-addon-api

Adopt C++20 defaulted comparisons (operator== / <=>)

オープン
#1,748 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

blocked SemVer-major
主要言語
C++
スター
2.4k
フォーク
499
平均マージ
2日 11時間
マージ済み PR(30日)
2

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

明示的な operator== と operator!= のペアを定義している node-addon-api の型を特定し、続いて順序比較について Maybe を調べます。冗長な != オーバーロードを削除し、比較動作を変更せずに、対象となる == または <=> 演算子を default 定義できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
api
issue の種類
リファクタリング
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
52/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。