Public Member Functions

Singleton< T, F, instance > Class Template Reference

#include <misc.h>

List of all members.

Public Member Functions

 Singleton (F objectFactory=F())
const T & Ref (...) const

Detailed Description

template<class T, class F = NewObject<T>, int instance = 0>
class Singleton< T, F, instance >

This function safely initializes a static object in a multithreaded environment without using locks (for portability). Note that if two threads call Ref() at the same time, they may get back different references, and one object may end up being memory leaked. This is by design.

Definition at line 108 of file misc.h.


The documentation for this class was generated from the following file: