From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101085 invoked by alias); 10 Oct 2016 17:49:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 101073 invoked by uid 89); 10 Oct 2016 17:49:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*r:112, mimics, skill, our X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Oct 2016 17:49:19 +0000 Received: by simark.ca (Postfix, from userid 112) id D7E1F1E159; Mon, 10 Oct 2016 13:49:17 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 07A6B1E124; Mon, 10 Oct 2016 13:49:17 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 10 Oct 2016 17:49:00 -0000 From: Simon Marchi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 1/3] Introduce gdb::unique_ptr In-Reply-To: <1476117992-5689-2-git-send-email-palves@redhat.com> References: <1476117992-5689-1-git-send-email-palves@redhat.com> <1476117992-5689-2-git-send-email-palves@redhat.com> Message-ID: <238251ad623cb3a2f8532f07a15dd263@simark.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.0 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00228.txt.bz2 This is clearly way above my C++ skill level, I feel like I'm reading boost code. But since it's well encapsulated in a "support" file and mimics the standard behaviors, I think it's good. I just hope the whole codebase won't end up lookup like this :). On 2016-10-10 12:46, Pedro Alves wrote: > - support for all of 'ptr != NULL', 'ptr == NULL' and 'if (ptr)' > using the safe bool idiom. Since our coding style doesn't allow the "if (ptr)" form, is it possible to make it cause a compile error? > +/* Base class of our unique_ptr emulation. Contains code common to > + both the unique_ptr and unique_ptr. */ > + > +template > +class unique_ptr_base : public safe_bool > > +{ > +public: > + typedef T *pointer; pointer_type?