managed singleton

  • Thread starter Thread starter Darren
  • Start date Start date
D

Darren

Does anyone know of an example for a managed singleton in vc 2005
syntax? I understand the singleton pattern but am having problems with
managed syntax.

TIA
 
Something like this should work :-

ref class R
{
R(){};
static R^ m_R = gcnew R();
public:
static R^ GetR()
{
return m_R;
}
};
 
Back
Top