Here is an implementation of a thread-safe* C++ singleton template. It's small, simple, and easy to use.
You can download the code snippet from here: Singleton.zip
* Only construction of the class instance created by the singleton is made thread-safe. Using members of the class are not specifically made thread-safe, and remains the programmers responsibility if necessary.
posted at: 21:00 | path: /Programming/OPB/Snippets | Permanent link to this entry | Add/View comments (1 existing)
Older posts (archives)...