description: "Use when writing or editing C++ code (.cpp/.h files). V-Gears C++14 style rules: naming, includes, const usage, casts, class layout, and documentation."
Full guide: doc/STYLE.md. Key rules enforced on every change:
noexcept when useful and correct.dynamic_cast, typeid) except in tests. Avoid macros, complicated templates, and forward declarations (acceptable only to break include loops).PascalCase (MyExcitingClass, AddTableEntry()).snake_case; private/protected class members get a trailing underscore (data_member_).UPPER_SNAKE_CASE.PascalCase.cpp / PascalCase.h; every .cpp has a matching .h except main() files and tests.#pragma once for include guards. Headers must be self-contained..cpp-only code internal linkage with static; never in headers.const before the type: const int* foo, not int const* foo.nullptr for pointers, '\0' for chars, sizeof(varname) over sizeof(type).static_cast<>), never C-style casts except to void.++i unless postfix semantics are needed.explicit single-argument constructors; override (or rarely final) on all overridden virtuals.public: → protected: → private:; structs only for passive data.