From da5321079ff8c642fd3df70b6fe6ce26bb2e45b6 Mon Sep 17 00:00:00 2001 From: Yue Wang Date: Fri, 24 Jul 2015 00:44:14 +1200 Subject: [PATCH] fixed #304 --- ch13/README.md | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/ch13/README.md b/ch13/README.md index 0b7b5340..accae205 100644 --- a/ch13/README.md +++ b/ch13/README.md @@ -151,18 +151,7 @@ The member (smart pointer and container) will be copied. ## Exercise 13.21: >Do you think the TextQuery and QueryResult classes need to define their own versions of the copy-control members? If so, why? If not, why not? Implement whichever copy-control operations you think these classes require. -(@Mooophy) -No copy-control members needed. - -Because, all these classes are using smart pointers to manage dynamic memory which can be freed automatically by calling synthesized destructors. The objects of these classes should share the same dynamic memory.Hence no user-defined version needed as well. - -```cpp -TextQuery(const TextQuery&) = delete; -TextQuery& operator=(const TextQuery&) = delete; - -QueryResult(const QueryResult&) = delete; -QueryResult& operator=(const QueryResult&) = delete; -``` +As synthesized version meet all requirements for this case, no custom version control memebers need to define. ## [Exercise 13.22](ex13_22.h)