This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Possible bug in shared_ptr(unique_ptr) constructor?
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Daniel Krügler <daniel dot kruegler at gmail dot com>
- Cc: Brad Spencer <spencer at starscale dot com>, "libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 8 Oct 2013 00:13:54 +0100
- Subject: Re: Possible bug in shared_ptr(unique_ptr) constructor?
- Authentication-results: sourceware.org; auth=none
- References: <20131007123915 dot GA11628 at starscale dot com> <CAH6eHdQFFO8EXFNavumHguHs5-wtDaDtJ=0kvY7E_WNHqydTrw at mail dot gmail dot com> <CAH6eHdRb-4nL-z7LZdLBwyjJHYY74NTCXDYJhcBaHeZLXzvC0g at mail dot gmail dot com> <20131007213416 dot GA6756 at starscale dot com> <CAH6eHdQuciTHxMTxFCoS93ar_o48LRY1FCcF986ok5msB4Y3HQ at mail dot gmail dot com> <CAGNvRgCzm+3Mqr7t7_UWbpe46fHzLpxWGd1vnXrMyZy=QfdKtg at mail dot gmail dot com>
On 7 October 2013 23:21, Daniel Krügler wrote:
>
> While reflecting about the same thing I found a third reason: The
> current specification of this moving transfer means that after the
> construction the programmer can query the free get_deleter template
> and can expect to get the owned deleter (irrespective of
> user-specialization), that is including default_delete<int> for
> example. This is different from querying shared_ptrs that do not *own*
> the deleter.
Oh yes, that's a very good point! The optimisation would be
non-conforming in all cases.