allow "auto" for named local lambdas and iterator types via claude.md

This commit is contained in:
2026-08-04 18:11:37 +02:00
parent 5d4a975384
commit 02c7fed9b4

View File

@@ -31,7 +31,14 @@ keep the citation accurate.
## Coding Guidelines
* 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.)
* wrap strings that appear in the UI with Qt's "tr()"
* use the EventManager/EventHandler instead of defining own signals and slots