NL.16 is ambiguous
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp, markdown
調査の方向性
NL.16のガイドラインと、issue #962、#977、#980で参照されている議論を読み、その後、commit edbfc3bにある以前の説明を確認してください。このissueでは、推奨される順序を明確にするため、2つのコード例のうち1つを追加することを提案しています。NL.16でどちらの順序が推奨されるかが明確に示されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Previously discussed in #962, #977, #980.
The recommendation according to the guideline is:
When declaring a class use the following order
- types: classes, enums, and aliases (
using)- constructors, assignments, destructor
- functions
- data
Use the
publicbeforeprotectedbeforeprivateorder.
These are two different dimensions, kind (types, special member functions, functions, data) and access (public, protected, private), without clearly stating which takes priority.
Discussion from editors on previous issues (i.e. comment which appears to reference comment) seems to indicate that access takes priority over kind:
class X {
public:
void f();
int i;
private:
void g();
int j;
};
At the same time, NL.16 was updated with the goal of clarifying, adding the text:
Sometimes, the default order of members conflicts with a desire to separate the public interface from implementation details. In such cases, private types and functions can be placed with private data.
Here, it's stated that "a desire to separate the public interface from implementation details" (i.e. grouping every kind of public member together, as in the above snippet) is in conflict with "the default order of members." This seems to indicate that this is not the default, which would mean that the default order of members is instead to prioritize kind over access:
class X {
public:
void f();
private:
void g();
public:
int i;
private:
int j;
};
So, the guideline as written does not clearly explain which dimension takes priority, and searching through the repository history shows that when this came up previously, there were two simultaneous but contradictory resolutions.
Suggestion: Provide one of the two above snippets as an unambiguous example of NL.16 showing the preferred first choice (when you have no constraints or better ideas).
- 主要言語
- CSS
- スター
- 45.5k
- フォーク
- 5.6k
- 平均マージ
- 6分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
isocpp/CppCoreGuidelines のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
isocpp/CppCoreGuidelines#2345 ·
-
Use short #s-xxx as ref, not long like #sl-the-standard-library or #gsl-guidelines-support-libraryオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
isocpp/CppCoreGuidelines#2340 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
isocpp/CppCoreGuidelines#2205 · コメント 8 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 64/100
isocpp/CppCoreGuidelines#1649 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
isocpp/CppCoreGuidelines#2342 · コメント 2 件 ·
isocpp/CppCoreGuidelines の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 75/100
cran-task-views/Spatial#130 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openclaw/openclaw-windows-node#2287 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
daniel-ospina/tortoise#13343 ·
メンテナーはふだん 1 日以内に返信
-
[Docs]: Clarify theme variables location and usage in CONTRIBUTING.md対応中かも @srishtimishra520-beep が今日担当しました。 オープンkind/docs
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
meshery/meshery.io#3220 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
current task
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
Sunday-School-Software/Sunday-School-Scheduler#87 ·
メンテナーはふだん 1 日以内に返信