mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
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:
parent
98b27a2ae8
commit
7c0863dccf
1 changed files with 0 additions and 15 deletions
|
@ -103,21 +103,6 @@ public:
|
|||
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
|
||||
{
|
||||
swap(other);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue