C++ Logo

std-proposals

Advanced search

Re: [std-proposals] A non-owning but self zeroing smart pointer for single ownership

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Mon, 17 Feb 2025 08:46:21 +0100
To be clear, I was not talking about different ownership, but same ownership, but the same flexibility as unique_ptr provides with custom deleters.   -----Ursprüngliche Nachricht----- Von:JOHN MORRISON via Std-Proposals <std-proposals_at_[hidden]> Gesendet:So 16.02.2025 22:07 Betreff:Re: [std-proposals] A non-owning but self zeroing smart pointer for single ownership An:std-proposals_at_[hidden]; CC:JOHN MORRISON <inglesflamenco_at_[hidden]>; Sebastian wrote: It is possible to change the order of the types   So that unique_ptr is the template argument instead of notify_ptrs.   In that way it would work with any resource.   It would be an efficient reference-counted abstraction for any object with ownership semantics.   Hi Sebastian,   I think what you are talking about here is way outside the scope of what I'm trying to do. You seem to be talking about a more generic approach that leverages notify_ptrs to manages a wider range of ownership possibilities. But notify_ptrs is strongly wedded to the structure of unique_ptr and would not work for instance with shared_ptr. Neither would I want it to because we already have weak_ptr that.   I would not want to change the order of the types because that would only further obscure the fact that what you have is just the well trusted unique_ptr with a deleter hook.   -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2025-02-17 07:50:37