C++/clr 单例模型
ref class Singleton
{
public:
static property Singleton^ Instance
{
Singleton^ get() { return m_lazy_instance->Value; }
}
private:
Singleton(); // Implemented in cpp
static Singleton^ CreateInstance() { return gcnew FbfsDllProviders(); }
static System::Lazy^ m_lazy_instance = gcnew System::Lazy(gcnew System::Func(CreateInstance));
};