Open El-even-11 opened 1 year ago
// copy-constructed
std::shared_ptr<Point> s4 = s3;
// copy-assigned
std::shared_ptr<Point> s4;
s4 = s3;
I totally agree with you too.
"std::shared_ptr<Point> s4 = s3
; " should be copy-construction, because it is the first time s4 appears.
"std::shared_ptr<Point> s4;
// default construction
s4 = s3;
" // copy-assignment.
and this is the situation where copy-assignment works.
yep, this looks like a typo. would you please submit a pull request? thanks!
https://github.com/cmu-db/15445-bootcamp/blob/e2d462b821e29440da1f038e61589866c32d9dad/src/shared_ptr.cpp#L79-L80
Might use copy-constructor here?