[patch] Use delegating constructors in std::shared_ptr

Václav Zeman vhaisman@gmail.com
Tue Apr 15 19:51:00 GMT 2014


On 04/15/2014 08:29 PM, Jonathan Wakely wrote:
> A minor simplification that removes a longstanding TODO note.
> 
> Tested x86_64-linux, committed to trunk.

> diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h
> index 081d3bd..104c869 100644
> --- a/libstdc++-v3/include/bits/shared_ptr.h
> +++ b/libstdc++-v3/include/bits/shared_ptr.h
> @@ -262,8 +262,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
>         *  @param  __p  A null pointer constant.
>         *  @post   use_count() == 0 && get() == nullptr
>         */
> -      constexpr shared_ptr(nullptr_t __p) noexcept
> -      : __shared_ptr<_Tp>(__p) { }
> +      constexpr shared_ptr(nullptr_t __p) noexcept : shared_ptr() { }
                                        ^^^

Will this not cause unused parameter warning or some such?

-- 
VZ



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 295 bytes
Desc: OpenPGP digital signature
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20140415/ab304fc4/attachment.sig>


More information about the Libstdc++ mailing list