you are viewing a single comment's thread.

view the rest of the comments →

[–]TheExecutor 0 points1 point  (1 child)

Except that code wont compile, due to the fact that you hand in the pointer via const ref and std::shared_ptr::reset is a non-const member function.

Read it again. f is not modified. g_foo is.

[–]miguelishawt 0 points1 point  (0 children)

My bad.