LoginSignup
63
51

More than 1 year has passed since last update.

C++ Core Guidelines タイトル日本語訳

Last updated at Posted at 2019-10-02

C++ Core Guidelinesの各ルールのタイトルの日本語訳です。

  • 間違いを見つけた場合は編集してもらえると助かります
  • Core Guidelinesがそれなりに高頻度で更新されているので、以下のルールのリストや原文は古い可能性があります
    • ただし、Core Guidelinesは機械的にチェックして警告を出すことも行われているので、ルールが消滅することは稀だと思われます

Abstact

In: Introduction / 導入

(略)

P: Philosophy / 指針

I: Interfaces / インターフェース

F: Functions / 関数

F.def: Function definitions / 関数定義

F.call: Parameter passing / 引数・戻り値の受け渡し

Parameter passing expression rules / 引数の表現のルール

Parameter passing semantic rules / 引数の意味論的なルール

Value return semantic rules / 戻り値の意味論的なルール

Other function rules / その他の関数のルール

C: Classes and class hierarchies / クラスとクラス階層

C.concrete: Concrete types / 具象型

C.ctor: Constructors, assignments, and destructors / コンストラクター、代入、デストラクター

C.defop: Default Operations / デフォルトの操作

C.dtor: Destructors / デストラクター

C.ctor: Constructors / コンストラクター

C.copy: Copy and move / コピーとムーブ

C.other: Other default operation rules / その他のデフォルト操作のルール

C.con: Containers and other resource handles / コンテナとその他のリソースハンドル

C.lambdas: Function objects and lambdas / 関数オブジェクトとラムダ

F.50, F.52, F.53, ES.28の引用のみ

C.hier: Class hierarchies (OOP) / クラス階層

C.hierclass: Designing classes in a hierarchy / 階層的なクラスの設計

C.hier-access: Accessing objects in a hierarchy / 階層的なクラスへのアクセス

C.over: Overloading and overloaded operators / オーバーロードと演算子オーバーロード

C.union: Unions / 共用体

Enum: Enumerations / 列挙

R: Resource management / リソース管理

R.alloc: Allocation and deallocation / 確保と解放

R.smart: Smart pointers / スマートポインター

ES: Expressions and statements / 式と文

ES.dcl: Declarations / 宣言

ES.expr: Expressions / 式

ES.stmt: Statements / 文

Arithmetic / 算術

Per: Performance / パフォーマンス

CP: Concurrency and parallelism / 並行・並列処理

CP.con: Concurrency / 並行処理

CP.par: Parallelism / 並列処理

未定義

CP.mess: Message passing / メッセージパッシング

CP.vec: Vectorization / ベクトル化

未定義

CP.free: Lock-free programming / ロックフリープログラミング

CP.etc: Etc. concurrency rules / その他

E: Error handling / エラーハンドリング

Con: Constants and immutability / 定数と不変性

T: Templates and generic programming / テンプレートとジェネリックプログラミング

T.gp: Generic programming / ジェネリックプログラミング

T.concepts: Concept rules / コンセプトのルール

T.con-use: Concept use / コンセプト利用時のルール

T.concepts.def: Concept definition rules / コンセプト定義時のルール

Template interfaces / テンプレートインターフェース

T.def: Template definitions / テンプレート定義

T.temp-hier: Template and hierarchy rules / テンプレートとクラス階層のルール

T.var: Variadic template rules / 可変引数テンプレートのルール

T.meta: Template metaprogramming (TMP) / テンプレートメタプログラミング

Other template rules / その他

CPL: C-style programming / Cスタイルプログラミング

SF: Source files / ソースファイル

SL: The Standard library / 標準ライブラリ

SL.con: Containers / コンテナ

SL.str: String / 文字列

SL.io: Iostream / 入出力ストリーム

SL.regex: Regex / 正規表現

未定義

SL.chrono: Time / 時間

未定義

SL.C: The C Standard Library / C標準ライブラリ

A: Architectural Ideas / アーキテクチャー

NR: Non-Rules and myths / ルールではないもの、迷信

RF: References / 参考文献

(略) 参考文献の説明であり、コーディングガイドラインではない。

Pro: Profiles / プロファイル

※ プロファイルは、C++ Core Guidelinesのルールを機械的に検証しやすいように選んだサブセットであり、目的にあわせて使うことができる。

Pro.type: Type safety / 型安全性

  • Type.1: Avoid casts:
    (キャストを避ける)
    • a. Don’t use reinterpret_cast; A strict version of Avoid casts(ES.48) and prefer named casts(ES.49).
      (reinterpret_castを使わない)
    • b. Don’t use static_cast for arithmetic types; A strict version of Avoid casts(ES.48) and prefer named casts(ES.49).
      (算術型へのstatic_castを使わない)
    • c. Don’t cast between pointer types where the source type and the target type are the same; A strict version of Avoid casts(ES.48).
      (ソースの型とターゲットの型が同じときはポインター型同士をキャストしない)
    • d. Don’t cast between pointer types when the conversion could be implicit; A strict version of Avoid casts(ES.48).
      (変換が暗黙的になる可能性があるときは、ポインター型同士をキャストしない)
  • Type.2: Don’t use static_cast to downcast: Use dynamic_cast instead(C.146).
    (ダウンキャストにはstatic_castではなくdynamic_castを使う(C.146))
  • Type.3: Don’t use const_cast to cast away const (i.e., at all): Don’t cast away const(ES.50).
    (constを外さない)
  • Type.4: Don’t use C-style (T)expression or functional T(expression) casts: Prefer construction(ES.64) or named casts(ES.49).
    (Cスタイルキャスト、関数スタイルのキャストを使用しない。その代わり、初期化(ES.64)や名前の付いたキャスト(ES.49)を用いる)
  • Type.5: Don’t use a variable before it has been initialized: always initialize(ES.20).
    (変数は初期化する前に一切使わない)
  • Type.6: Always initialize a member variable: always initialize(ES.20), possibly using default constructors(C.43) or default member initializers(C.48).
    (メンバー変数を必ず初期化する(ES.20)、特に、デフォルトコンストラクタ(C.43)またはデフォルトメンバー初期化子(C.48)を使う)
  • Type.7: Avoid naked union: Use variant instead(C.181).
    (裸のunionを避け、variantを使う(C.181))
  • Type.8: Avoid varargs: Don’t use va_arg arguments(F.55).
    (可変長引数を使わない、特に、va_argを使わない(F.55))

Pro.bounds: Bounds safety / 境界安全性

  • Bounds.1: Don’t use pointer arithmetic. Use span instead: Pass pointers to single objects (only)(I.13) and Keep pointer arithmetic simple.(ES.42)
    (ポインターの算術演算を使わず、spanを使う。ポインターは1つのオブジェクトを表すためだけに使用する(I.13)。ポインターの演算は単純にする(ES.42))
  • Bounds.2: Only index into arrays using constant expressions: Pass pointers to single objects (only)(I.13) and Keep pointer arithmetic simple.(ES.42)
    (配列への添え字は定数式だけを使う。ポインターは1つのオブジェクトを表すためだけに使用する(I.13)。ポインターの演算は単純にする(ES.42))
  • Bounds.3: No array-to-pointer decay: Pass pointers to single objects (only)(I.13) and Keep pointer arithmetic simple.(ES.42)
    (配列からポインターへのdecayを利用しない。ポインターは1つのオブジェクトを表すためだけに使用する(I.13)。ポインターの演算は単純にする(ES.42))
  • Bounds.4: Don’t use standard-library functions and types that are not bounds-checked: Use the standard library in a type-safe manner(SL.con.3).
    (境界チェックのない標準ライブラリ関数と型を使用しない。標準ライブラリでの境界エラーを避ける(SL.con.3))

Pro.lifetime: Lifetime safety / ライフタイム安全性

  • Lifetime.1: Don’t dereference a possibly invalid pointer: detect or avoid(ES.65).
    (無効になる可能性のあるポインターをデリファレンスしない。検出するか回避する(ES.65))

GSL: Guideline support library / ガイドラインサポートライブラリ

(略) GSLの説明であり、コーディングガイドラインではない。GSLはC++ Core Guidelinesをサポートするライブラリで、ルールの中にはGSLに依存するものがある。

NL: Naming and layout / 名前付けとレイアウト

63
51
8

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
63
51