Add readonly models for collection concepts - #130
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #78
Introduces CReadonlyDictionary, CReadonlyList, and CReadonlySet concepts that preserve const qualifiers instead of stripping them with std::remove_const_t. This enables proper readonly collections that only expose const methods. - Add CReadonlyDictionaryHelpFunction that uses const Self instead of removing const qualifier - Add CReadonlyListHelpFunction with const-only operations (size, empty, indexing) - Add CReadonlySetHelpFunction with const-only operations (find, contains, size, empty) - Add corresponding ReadonlyDictionary, ReadonlyList, and ReadonlySet structs - Include test example demonstrating const qualification preservation Fixes #78 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
🤖 AI Work Session Started Starting automated work session at 2026-09-21T09:50:14.848Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. Runtime: solve |
Working session summaryImplemented, pushed, and marked ready for review: PR #130. Key results:
This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:
Total: (140.9K + 7.2M cached) input tokens, 33.6K output tokens, $7.893810 cost 🤖 Models used:
📎 Log file uploaded as Gist (2486KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |


Summary
Resolves #78 by adding const-only models for the mutable collection concepts:
CReadonlyDictionaryandReadonlyDictionaryCReadonlyListandReadonlyListCReadonlySetandReadonlySetThe readonly concepts evaluate their operations through
constreferences, so a collection can expose iteration, lookup, indexing, size, and emptiness without implementing mutation.Additional fixes
CReadonlyList<const T, Item>accepts a const item reference.DictionaryandReadonlyDictionary, allowing theirKeyandValuealiases to instantiate.0.3.42to0.3.43.Reproduction and regression coverage
The regression types expose only const collection operations. Compile-time assertions verify:
Before the fix, the explicit-item list assertion failed and the readonly dictionary trait aliases did not instantiate.
Verification
git diff --checkResolves #78