IntrusivePtr: remove reset(), nobody uses it

This method mimicks std::unique_ptr::reset(), but adds an obscure
"add_ref" parameter which is error prone.  Since nobody uses this
method, and this method is all about dealing with raw pointers which
we shouldn't be doing, let's remove it.
This commit is contained in:
Max Kellermann 2020-02-19 05:52:32 +01:00
parent 98b27a2ae8
commit 7c0863dccf

View file

@ -103,21 +103,6 @@ public:
return result; return result;
} }
/**
* Convenience function for assigning a new raw pointer. Equivalent to calling
* @c operator= with an @c IntrusivePtr constructed from the arguments.
* @param new_value Pointer to the new shared object.
* @param add_ref Denotes whether the reference count of the new shared object
* shall be increased.
*/
void reset(pointer new_value = nullptr, bool add_ref = true) noexcept
{
auto old = ptr_;
setPtr(new_value, add_ref);
if ( old )
Unref(old);
}
IntrusivePtr& operator=(IntrusivePtr other) noexcept IntrusivePtr& operator=(IntrusivePtr other) noexcept
{ {
swap(other); swap(other);