class
CSingleton final
{
public
:
static
CSingleton& GetInstance();
private
:
CSingleton() =
default
;
~CSingleton() =
default
;
CSingleton(
const
CSingleton&) =
delete
;
CSingleton& operator=(
const
CSingleton&) =
delete
;
CSingleton(CSingleton&&) =
delete
;
CSingleton& operator=(CSingleton&&) =
delete
;
};
CSingleton& CSingleton::GetInstance()
{
static
CSingleton instance;
return
instance;
}
转载:点击打开链接