General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
pqsk
Low Level
comments
Comments by "pqsk" (@pqsk) on "are "smart pointers" actually smart?" video.
But the do_something_with_the_dog, isn't that pass by value? Or is it by reference? In C you'd have to pass a double ptr for pass by reference in order to dealloc. You can modify the members, but the free would do nothing. I just forget the different rules in c++ so maybe I am wrong. I get the point though, but was curious if I was wrong
3
@sinom but I’m talking about the original function when it’s just a pointer and the last line delete is called. It wasn’t compiled or ran so I’m just not sure that would work. Again, totally get the point that the video is getting at, but, like you also explained, it would just send a copy which wouldn’t cause a bug.
2
@ezekieloruven ah yes. That’s right.
1