C++ Singleton: Beware of Circular Reference Risks and Reject Mutual Dependencies
Circular references in singletons are most likely to occur in logging modules and configuration management modules. If a circular reference is triggered during the construction phase, it can be guaranteed by the uniqueness of static variable initialization in C++11. The danger lies in triggering a circular reference during the destruction phase, which can lead … Read more