[C++0x] nullptr

Jonathan Wakely jwakely.gcc@gmail.com
Mon May 3 00:35:00 GMT 2010


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.



More information about the Gcc-patches mailing list