Skip to content

Instantly share code, notes, and snippets.

@tophyr
Created October 9, 2015 18:10
Show Gist options
  • Save tophyr/6fc886a2b3d4b92710b2 to your computer and use it in GitHub Desktop.
Save tophyr/6fc886a2b3d4b92710b2 to your computer and use it in GitHub Desktop.
template<typename T>
class sp {
...
};
template<typename T>
sp<T> wp<T>::promote() const
{
sp<T> result;
if (m_ptr && m_refs->attemptIncStrong(&result)) {
result.set_pointer(m_ptr);
}
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment