#include <iostream>
using namespace std;
class Singleton
{
public:
static Singleton *Getinstance()
{
if(p!=NULL)
{
return p;
}
else
{
p=new Singleton;
r[......]
独立件简单的singleton用c++实现
Leave a reply
#include <iostream>
using namespace std;
class Singleton
{
public:
static Singleton *Getinstance()
{
if(p!=NULL)
{
return p;
}
else
{
p=new Singleton;
r[......]