Spell out the types that the recent changes had left to auto - #43
Merged
tomluchowski merged 1 commit intoAug 27, 2026
Merged
Conversation
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>
Owner
|
I love how quickly you respond :) , many thanks for that ....
versus 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 .... |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #42: every
autothat the changes merged over the last month introduced is written out as its real type, and aCLAUDE.mdat the repository root tells the assistant to keep doing so.What changed
The 14
autodeclarations added by the recent merged PRs (#23 room split, #24 seat fixes, #26 console test, #34 per-tile bridge claiming) are now explicit:source/rooms/RoomBridge.cpp(6)auto it = mTileData.find(tile)etc.std::map<Tile*, TileData*>::iterator/::const_iteratorinexportToStream() const,std::vector<Tile*>::iterator,std::map<Tile*, BuildingObject*>::iteratorsource/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*>::iteratorsource/rooms/RoomTreasury.cpp(1)auto it = mTileData.find(tile)std::map<Tile*, TileData*>::iteratorsource/game/Seat.cpp(1)auto it = mTilesStates.find(tile)std::map<Tile*, TileStateNotified>::iteratorsource/tests/test_ConsoleInterface.cpp(2)auto execute = [...],auto result = ...std::function<Command::Result(const std::string&, TestModeManager::ModeType)>,Command::ResultNo behaviour changes: each replacement is the type the expression already had.
CLAUDE.mdis picked up automatically by Claude Code at the start of every session; it states the no-autorule with examples, the C++11 baseline and the surrounding style conventions (indentation, braces,if(,mprefix,OD_LOG_*).Not touched
The 195
autodeclarations 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