Skip to content

Instantly share code, notes, and snippets.

@George3d6
Last active September 16, 2018 23:06
Show Gist options
  • Save George3d6/630f2cbee35196c69790c1e1686f4491 to your computer and use it in GitHub Desktop.
Save George3d6/630f2cbee35196c69790c1e1686f4491 to your computer and use it in GitHub Desktop.
std::weak_ptr non_owner_ptr;
if (auto shared_owner_ptr = non_owner_ptr.lock()) {
shared_owner_ptr->do_stuff()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment