This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/58159] unique_ptr::reset should have debug assertion for "self-reset"


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58159

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
What if the deleter doesn't actually destroy the object, and doing self-reset
is used as a crazy way to trigger the deleter to do something with the pointer,
but not to alter the value of the pointer?

If that's valid then we should only do this for default_delete specializations.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]