From 646f9e183627d0cffed60decdcb579764586ed80 Mon Sep 17 00:00:00 2001 From: LSuper <120311070@qq.com> Date: Wed, 23 Feb 2022 17:04:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=AE=BE=E8=AE=A1=E6=A8=A1=E5=BC=8FMeyers?= =?UTF-8?q?'=20Singleton=E5=8E=BB=E6=8E=89=E5=86=97=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E9=81=BF=E5=85=8D=E8=AF=AF=E5=AF=BC=E6=B7=B7?= =?UTF-8?q?=E6=B7=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- design_pattern/singleton/static_local_singleton.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/design_pattern/singleton/static_local_singleton.cpp b/design_pattern/singleton/static_local_singleton.cpp index 87626bc..c178985 100644 --- a/design_pattern/singleton/static_local_singleton.cpp +++ b/design_pattern/singleton/static_local_singleton.cpp @@ -1,5 +1,7 @@ // // Created by light on 20-2-7. +// 在C++11标准下,《Effective C++》提出了一种更优雅的单例模式实现,使用函数内的 local static 对象。 +// 这种方法也被称为Meyers' Singleton。 // #include @@ -8,7 +10,6 @@ using namespace std; class singleton { private: - static singleton *p; singleton() {} public: static singleton &instance();