What problem does it solve?
Enforce C++ coding standards to prevent style drift, improve readability, and ensure maintainability across large codebases.
Core Features & Use Cases
- File Naming: Source files use snake_case or PascalCase; header files share the same base name with .h, .hpp, or .hxx extensions; templates use .tpp or .inl.
- Header Guards / Pragma: Prefer #pragma once or traditional guards using UPPER_SNAKE_CASE with a _HPP suffix.
- Namespace Naming: Namespaces should be all lowercase or snake_case; nested namespaces may use C++17 syntax when possible.
- Variable Naming: Local variables use snake_case or camelCase; member variables are prefixed with m_ or suffixed with ; static members prefixed with s; constants use UPPER_SNAKE_CASE or kPascalCase; global variables prefixed with g_.
- Function/Method Naming: Free functions use snake_case or camelCase; member functions use camelCase or PascalCase; getters/setters follow getName / setName patterns; factory functions use Create, Make, or Build.
- Class/Type Naming: Classes and structs use PascalCase; interfaces optionally use I- prefix; template parameters are single letters or descriptive PascalCase; enums use PascalCase for type and UPPER_SNAKE_CASE for values; type aliases use PascalCase.
- Smart Pointers: Prefer std::unique_ptr for single ownership and std::shared_ptr for shared ownership; avoid raw new/delete.
- Organization: Include guards or pragma once; keep system includes alphabetized, then project includes; use forward declarations; open namespaces; declare classes and inline/template implementations.
Quick Start
Run a code review pass to align file naming, guards, namespaces, and naming conventions across your C++ project.