Skip to content

Commit

Permalink
fixed #304
Browse files Browse the repository at this point in the history
  • Loading branch information
Mooophy committed Jul 23, 2015
1 parent 2cd0733 commit da53210
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions ch13/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit da53210

Please sign in to comment.