From 8c3b7a6a8755aedb46e1de2c1ebcf15aa28a02b8 Mon Sep 17 00:00:00 2001 From: FengJungle Date: Wed, 20 Oct 2021 00:52:42 +0800 Subject: [PATCH] bugfix: delete copy ctr and copy assign for non-trivial class --- 22.StrategyPattern/2.Code/Context.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/22.StrategyPattern/2.Code/Context.h b/22.StrategyPattern/2.Code/Context.h index fdc0bd2..31b1c1c 100644 --- a/22.StrategyPattern/2.Code/Context.h +++ b/22.StrategyPattern/2.Code/Context.h @@ -18,6 +18,8 @@ public: this->N = iN; sortStrategy = nullptr; } + Context(const Context& context) = delete; + Context& operator=(const Context&) = delete; ~Context() { if(sortStrategy)