managed singleton

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
 
N

Nishant Sivakumar

Something like this should work :-

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top