From 73c881af13f6f9e0e016f694a48f83bf9e6c866e Mon Sep 17 00:00:00 2001 From: xiaoyudoudou <964877814@qq.com> Date: Tue, 26 May 2020 11:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 初始化列表,初始m_pComponent初始值 --- code/Decorator/Decorator.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/Decorator/Decorator.cpp b/code/Decorator/Decorator.cpp index 0888eed..93f1128 100644 --- a/code/Decorator/Decorator.cpp +++ b/code/Decorator/Decorator.cpp @@ -8,8 +8,7 @@ #include "Decorator.h" -Decorator::Decorator(Component* pcmp){ - m_pComponent = pcmp; +Decorator::Decorator(Component* pcmp): m_pComponent(pcmp){ } Decorator::~Decorator(){ @@ -18,4 +17,4 @@ Decorator::~Decorator(){ void Decorator::operation(){ m_pComponent->operation(); -} \ No newline at end of file +}