Singleton 模式文件

// .h
//
#pragma once

#include <iostream>
using namespace std;

#define DECLEAR_SINGLE_INSTANCE(T) \
private:static T m_SingletonInstance; \
public:static T* Instance(){ return &m_SingletonInstance;}

#define IMPLEMENT_SINGLE_INSTANCE(T) \
T T::m_SingletonInstance;

class CSystemConfig
{
public:
CSystemConfig(){}
~CSystemConfig(){}
public:
DECLEAR_SINGLE_INSTANCE(CSystemConfig);
public:
void Initialize()
{
cout<<""<<endl;
cout<<""<<endl;
}

};


测试文件

#include "Singleton.h"

IMPLEMENT_SINGLE_INSTANCE(CSystemConfig) // 怎么解释这句话的功能呢?

void main()
{
CSystemConfig::Instance()->Initialize();
}