Re: [committed] libstdc++: Simplify std::shared_ptr construction from std::weak_ptr

2020-10-26 Thread Jonathan Wakely via Gcc-patches
On 26/10/20 08:07 +0100, Stephan Bergmann wrote: On 21/10/2020 22:14, Jonathan Wakely via Gcc-patches wrote: The _M_add_ref_lock() and _M_add_ref_lock_nothrow() members of _Sp_counted_base are very similar, except that the former throws an exception when the use count is zero and the latter retu

Re: [committed] libstdc++: Simplify std::shared_ptr construction from std::weak_ptr

2020-10-26 Thread Stephan Bergmann via Gcc-patches
On 21/10/2020 22:14, Jonathan Wakely via Gcc-patches wrote: The _M_add_ref_lock() and _M_add_ref_lock_nothrow() members of _Sp_counted_base are very similar, except that the former throws an exception when the use count is zero and the latter returns false. The former (and its callers) can be imp

[committed] libstdc++: Simplify std::shared_ptr construction from std::weak_ptr

2020-10-21 Thread Jonathan Wakely via Gcc-patches
The _M_add_ref_lock() and _M_add_ref_lock_nothrow() members of _Sp_counted_base are very similar, except that the former throws an exception when the use count is zero and the latter returns false. The former (and its callers) can be implemented in terms of the latter. This results in a small reduc