Meyers Singleton is elegant and fast and considered the default solution However... - we want an "instance" pointer that can be rebound and reset, and thus we are forced to use an explicit Mutex and an atomic variable. And the situation is such that the optimiser can not detect/verify this usage and thus generates a spurious additional lock for Meyers Singleton - we want the option to destroy our singletons explicitly - we need to create an abstracted closure for the ctor invocation - we need a compiletime-branch to exclude code generation for invoking the ctor of an abstract baseclass or interface All those points would be somehow manageable, but would counterfeit the simplicity of Meyers Singleton |
||
|---|---|---|
| .. | ||
| clang-static-init-1.cpp | ||
| clang-static-init-2.cpp | ||
| clang-static-init.hpp | ||
| crash_gdb_jessie-2015-08.sh | ||
| DIR_INFO | ||
| SConscript | ||
| try.cpp | ||