Skip to content

Spell out the types that the recent changes had left to auto - #43

Merged
tomluchowski merged 1 commit into
tomluchowski:shaders-improvementfrom
Upabjojr:split/explicit-types
Aug 27, 2026
Merged

Spell out the types that the recent changes had left to auto#43
tomluchowski merged 1 commit into
tomluchowski:shaders-improvementfrom
Upabjojr:split/explicit-types

Conversation

@Upabjojr

Copy link
Copy Markdown

Addresses #42: every auto that the changes merged over the last month introduced is written out as its real type, and a CLAUDE.md at the repository root tells the assistant to keep doing so.

What changed

The 14 auto declarations added by the recent merged PRs (#23 room split, #24 seat fixes, #26 console test, #34 per-tile bridge claiming) are now explicit:

File Before After
source/rooms/RoomBridge.cpp (6) auto it = mTileData.find(tile) etc. std::map<Tile*, TileData*>::iterator / ::const_iterator in exportToStream() const, std::vector<Tile*>::iterator, std::map<Tile*, BuildingObject*>::iterator
source/rooms/Room.cpp (4) auto it = remaining.find(neigh) etc. std::set<Tile*>::iterator, std::map<Tile*, TileData*>::iterator, std::vector<Tile*>::iterator, std::map<Tile*, BuildingObject*>::iterator
source/rooms/RoomTreasury.cpp (1) auto it = mTileData.find(tile) std::map<Tile*, TileData*>::iterator
source/game/Seat.cpp (1) auto it = mTilesStates.find(tile) std::map<Tile*, TileStateNotified>::iterator
source/tests/test_ConsoleInterface.cpp (2) auto execute = [...], auto result = ... std::function<Command::Result(const std::string&, TestModeManager::ModeType)>, Command::Result

No behaviour changes: each replacement is the type the expression already had.

CLAUDE.md is picked up automatically by Claude Code at the start of every session; it states the no-auto rule with examples, the C++11 baseline and the surrounding style conventions (indentation, braces, if(, m prefix, OD_LOG_*).

Not touched

The 195 auto declarations that predate these PRs (hwoarangmy, 2015, spread over 59 files) are left as they are, since the issue is about what the assistant added. Converting those too is mechanical and can be a follow-up PR if wanted.

The still-open PRs #20, #32, #33 and #35 each got a commit of their own doing the same for the autos in their diffs; #16 is the umbrella branch the split PRs were cut from and is left alone.

Verification

Full build (RelWithDebInfo, GCC) and the console test run and pass.

🤖 Generated with Claude Code

Issue tomluchowski#42 asks for explicit types instead of auto. The fourteen auto
declarations added by the last month's merged changes (room split,
per-tile bridge claiming, the seat tile-state lookup and the console
test) now name their iterator, std::function or Command::Result type.
No behaviour changes.

A CLAUDE.md at the repository root records the rule, along with the
C++11 baseline and the surrounding style conventions, so the assistant
keeps to it in future sessions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tomluchowski

tomluchowski commented Aug 27, 2026

Copy link
Copy Markdown
Owner

I love how quickly you respond :) , many thanks for that ....

ack auto */*.cpp | wc 222 1413 19590

versus
ack auto */*.cpp | wc 208 1331 18447

So there is always progress . @Upabjojr you are always welcome to tinker with the code style and express your own opinions on that, but I really feel the auto is spourious most of the times ....

@tomluchowski
tomluchowski merged commit 3adb1b5 into tomluchowski:shaders-improvement Aug 27, 2026
@Upabjojr

Copy link
Copy Markdown
Author

I believe that code styling will progressively become less important in the future... as less and less humans will write the code by hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants