Such article can end up with a 'false balance' bias by introducing and showing a method one should avoid to motivate the solution. What some people learn is "there are two options".
Maybe it works be better to start with "that's how we do it" and only afterwards following up with "and that's why".
He's making it massively more complex than it actually is
{ // this scope is owner
// allocate
auto my_obj = MyObj{};
// this function scope does not have ownership of my_obj, should take (const MyObj& obj) const reference as parameter
do_something(my_obj);
bulbar|1 month ago
Maybe it works be better to start with "that's how we do it" and only afterwards following up with "and that's why".
jurschreuder|1 month ago
{ // this scope is owner
} // memory is released