Files
wehub-resource-sync d48cda4081
CI / Test (ubuntu-latest, Node 18.x, bun) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, npm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, pnpm) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 18.x, yarn) (push) Failing after 15m1s
CI / Test (ubuntu-latest, Node 20.x, bun) (push) Failing after 17m13s
CI / Test (ubuntu-latest, Node 20.x, npm) (push) Failing after 18m42s
CI / Test (ubuntu-latest, Node 20.x, pnpm) (push) Failing after 15m0s
CI / Test (ubuntu-latest, Node 20.x, yarn) (push) Failing after 49m44s
CI / Test (ubuntu-latest, Node 22.x, bun) (push) Failing after 51m55s
CI / Test (ubuntu-latest, Node 22.x, pnpm) (push) Failing after 21m57s
CI / Test (ubuntu-latest, Node 22.x, npm) (push) Failing after 37m39s
CI / Test (ubuntu-latest, Node 22.x, yarn) (push) Failing after 34m7s
CI / Validate Components (push) Failing after 37m15s
CI / Python Tests (push) Failing after 10m1s
CI / Security Scan (push) Failing after 10m1s
CI / Lint (push) Failing after 17m12s
CI / Coverage (push) Failing after 20m19s
CI / Test (macos-latest, Node 18.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 18.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 20.x, yarn) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, bun) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (macos-latest, Node 22.x, yarn) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, npm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, pnpm) (push) Has been cancelled
CI / Test (windows-latest, Node 22.x, yarn) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:55 +08:00

1.5 KiB
Raw Permalink Blame History

paths
paths
**/*.cpp
**/*.hpp
**/*.cc
**/*.hh
**/*.cxx
**/*.h
**/CMakeLists.txt

C++ コーディングスタイル

このファイルは common/coding-style.md を C++ 固有のコンテンツで拡張します。

モダン C++C++17/20/23

  • C スタイルの構文よりもモダン C++ の機能を優先する
  • コンテキストから型が明らかな場合は auto を使用する
  • コンパイル時の定数には constexpr を使用する
  • 構造化バインディングを使用する: auto [key, value] = map_entry;

リソース管理

  • RAII を徹底する — 手動での new/delete は禁止
  • 独占的な所有権には std::unique_ptr を使用する
  • 共有所有権が本当に必要な場合のみ std::shared_ptr を使用する
  • 生の new の代わりに std::make_unique / std::make_shared を使用する

命名規則

  • 型/クラス: PascalCase
  • 関数/メソッド: snake_case または camelCase(プロジェクトの規約に従う)
  • 定数: kPascalCase または UPPER_SNAKE_CASE
  • 名前空間: lowercase
  • メンバー変数: snake_case_(末尾アンダースコア)または m_ プレフィックス

フォーマット

  • clang-format を使用する — スタイルの議論は不要
  • コミット前に clang-format -i <file> を実行する

参考

包括的な C++ コーディング標準とガイドラインについてはスキル: cpp-coding-standards を参照。