I have some cases where I need to clear (reset(nullptr)) the content of a uniqueptr which may or may not be already cleared.
If it is already clear the assertion in `assert(p != p);is triggered. I was wondering if this should be the case since clearing what is already clear does seem fine to me. I propose the assertion to be changed toassert(p == nullptr || p != p);, or maybe implement the overloadedvoid reset( std::nullptr_t = nullptr )`
What do you think?
Hi,
I have some cases where I need to clear (
reset(nullptr)
) the content of a uniqueptr which may or may not be already cleared. If it is already clear the assertion in `assert(p != p);is triggered. I was wondering if this should be the case since clearing what is already clear does seem fine to me. I propose the assertion to be changed to
assert(p == nullptr || p != p);, or maybe implement the overloaded
void reset( std::nullptr_t = nullptr )` What do you think?Regards, Manuel