From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10661 invoked by alias); 13 Oct 2016 01:06:52 -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 10625 invoked by uid 89); 13 Oct 2016 01:06:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:number_ X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Oct 2016 01:06:50 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C3CB881239; Thu, 13 Oct 2016 01:06:49 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9D16mqX005423; Wed, 12 Oct 2016 21:06:49 -0400 Subject: Re: [RFA 19/22] Convert tid_range_parser to class To: Tom Tromey References: <1474949330-4307-1-git-send-email-tom@tromey.com> <1474949330-4307-20-git-send-email-tom@tromey.com> <55f2924c-f8f9-6c06-ffbb-69079b6ffa62@redhat.com> <87shsha3bf.fsf@tromey.com> <926126cb-b3c5-340b-ac1c-5bc14ca41bf9@redhat.com> <42bd9696-cea5-5f39-ce03-1b223b5ed6fc@redhat.com> <5cae4120-3581-b3ca-b323-44d8788e2916@redhat.com> <87mvianwnl.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <0fc71aec-b418-cc4c-6c17-d7bf41dc643a@redhat.com> Date: Thu, 13 Oct 2016 01:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <87mvianwnl.fsf@tromey.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00339.txt.bz2 On 10/12/2016 03:11 AM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> Here's what I ended up with, after reading your version in more > Pedro> detail. That brought in the "deleted" copy > Pedro> constructor/assignment operators [1], and "const" in several > Pedro> methods, which I then propagated to number_or_range_parser too. > > Pedro> WDYT? > > I'm sorry I didn't reply to this sooner. > This all looks good to me. OK, I've pushed it in now. Thanks! > Pedro> [1] - I'm pondering making those use =delete if compiling with > Pedro> a C++ compiler, behind some > Pedro> #define DISABLE_COPY_AND_ASSIGN(TYPE) ... > Pedro> macro. > > Pedro> Or, maybe add a gdb::noncopyable class that non-copyable > Pedro> classes inherit from privately, just like boost:noncopyable. > Pedro> Anyone got experience on the latter, and whether that turns > Pedro> out to be a bad idea? > > I haven't used that. > The Moz approach that Trevor mentioned seems reasonable. > Or, just switching to C++11, per the other thread, and using =delete. Yeah. Thanks, Pedro Alves