Open
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #23
Complete translation of Platform.Singletons from C# to C++: - Global.h/.cpp: Translated Global static class with Trash property - Default[T].h: Translated Default<T> template class with Instance and ThreadInstance - Singleton.h: Translated SingletonFactory class for creating singletons - Singleton[T].h: Translated Singleton<T> struct with function-based singleton creation - Updated all test files with proper C++ syntax and testing approach - Created CMakeLists.txt for building the project - All tests pass successfully Key differences from C# version: - Used std::unordered_map instead of ConcurrentDictionary - Used std::mutex for thread safety instead of concurrent collections - Used function object address for uniqueness instead of IL byte comparison - Used C++17 features like template argument deduction 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
🤖 AI-Powered Solution
This pull request successfully translates the C# Platform.Singletons library to C++.
📋 Issue Reference
Fixes #23
✅ Implementation Complete
Core Components Translated:
Global.h/.cpp - Static global class with Trash property for performance testing
Default[T].h - Template class providing default instances
static_assertfor default constructibility constraintSingletonFactory (Singleton.h) - Factory class for creating singletons
Singleton[T].h - Template struct for function-based singleton management
Testing & Build System:
Key Technical Differences from C#:
ConcurrentDictionarystd::unordered_map+std::mutex[ThreadStatic]thread_localnew()constraintstd::is_default_constructible_v<T>constraintLimitations:
The C++ version has one known limitation compared to the C# version:
Build & Test:
🏁 Status
Ready for Review - Complete translation with passing tests and full CMake build system.
🤖 Generated with Claude Code