[PATCH v3] Introduce gdb::unique_ptr

Pedro Alves palves@redhat.com
Fri Oct 14 16:31:00 GMT 2016


On 10/14/2016 05:10 PM, Pedro Alves wrote:
> On 10/14/2016 05:07 PM, Simon Marchi wrote:
>> On 2016-10-14 08:50, Pedro Alves wrote:
>>> +struct unique_ptr_nullptr_t
>>> +{
>>> +private:
>>> +  struct private_type;
>>> +public:
>>> +  /* Since null_type is private, the only way to construct this class
>>
>> null_type, or private_type?
> 
> Whoops, yes, private_type.  Used to be called null_type, but then
> I renamed it thinking that it'd be clearer.

I've changed the comment locally to this:

struct unique_ptr_nullptr_t
{
private:
  struct private_type;
public:
  /* Since private_type is private, the only way to construct this
     class is by passing a NULL pointer.
     See unique_ptr_base::operator= (const unique_ptr_nullptr_t &).  */
  unique_ptr_nullptr_t (private_type *) {}
};

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list