allow "auto" for named local lambdas and iterator types via claude.md
This commit is contained in:
@@ -31,7 +31,14 @@ keep the citation accurate.
|
|||||||
## Coding Guidelines
|
## Coding Guidelines
|
||||||
|
|
||||||
* avoid duplicate code
|
* avoid duplicate code
|
||||||
* do not use the "auto" keyword
|
* do not use the "auto" keyword, with two exceptions:
|
||||||
|
* **named local lambdas** — a lambda's type is unnameable, and `std::function`
|
||||||
|
is not an acceptable substitute in per-tick code because it adds a heap
|
||||||
|
allocation and an indirect call
|
||||||
|
* **iterator types** — `auto it = m_buildings.find(id)` is allowed where
|
||||||
|
spelling the iterator out adds length without adding information
|
||||||
|
* everywhere else the type is written out; in particular `auto` is not used
|
||||||
|
for plain values, return values, or range-for element types
|
||||||
* use Qt utility data types (like QPoint, QVector3D, QString, etc.)
|
* use Qt utility data types (like QPoint, QVector3D, QString, etc.)
|
||||||
* wrap strings that appear in the UI with Qt's "tr()"
|
* wrap strings that appear in the UI with Qt's "tr()"
|
||||||
* use the EventManager/EventHandler instead of defining own signals and slots
|
* use the EventManager/EventHandler instead of defining own signals and slots
|
||||||
|
|||||||
Reference in New Issue
Block a user