This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [C++0x] nullptr
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- Cc: Magnus Fromreide <magfr at lysator dot liu dot se>, Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Thu, 13 May 2010 11:04:43 +0200
- Subject: Re: [C++0x] nullptr
- References: <1268546192.2028.32.camel@sara.home> <4BA46E77.6080507@redhat.com> <1269813166.2249.8.camel@sara.home> <4BB12B74.80703@redhat.com> <4BDD0915.2020301@redhat.com> <1272842221.2000.26.camel@sara.home> <s2x4348dea51005021734p72dff67cxb3b0fc26b6484400@mail.gmail.com>
Hi,
> On 3 May 2010 00:17, Magnus Fromreide wrote:
>
>> (libstdc++-folks, there is a library patch in here that I would like to
>> get reviewed if possible)
>>
> + /**
> + * @brief Construct an empty %shared_ptr.
> + * @param __p A null pointer constant.
> + * @post use_count() == 1 && get() == nullptr
> + */
> template<typename _Tp1>
> + shared_ptr(nullptr_t __p) : __shared_ptr<_Tp>() { }
>
> This should not be a template, and I think the comment and effects are
> wrong, it's not empty, since it owns the null pointer. That means the
> base class should not be default constructed.
>
Jonathan, now that the front-end changes are in and pretty solid after
the last patch from Jason, are you willing to tweak and apply the
library changes?
Thanks,
Paolo.