15 ms·
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
by jurschreuder 9mo ago
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);
} // memory is released