logoalt Hacker News

jurschreudertoday at 5:17 AM0 repliesview on HN

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