-
Notifications
You must be signed in to change notification settings - Fork 245
Open
Description
In ch13/13.28.cpp, line 173:
BinStrTree::BinStrTree(const BinStrTree &rhs) : root(new TreeNode(*rhs.root)), use(rhs.use) { ++*use; }
As BinStrTree implements the pointer-like copy control members, I think root should be initialized with rhs.root, not new TreeNode(*rhs.root).
The code might be changed to:
BinStrTree::BinStrTree(const BinStrTree &rhs) : root(rhs.root), use(rhs.use) { ++*use; }
Metadata
Metadata
Assignees
Labels
No labels