From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 89cSBdH2AWD9SAAAWB0awg (envelope-from ) for ; Fri, 15 Jan 2021 15:10:57 -0500 Received: by simark.ca (Postfix, from userid 112) id 0561E1EF80; Fri, 15 Jan 2021 15:10:57 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A4EBB1E590 for ; Fri, 15 Jan 2021 15:10:56 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 044343987C31; Fri, 15 Jan 2021 20:10:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 044343987C31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610741456; bh=Jm7K1eUgZFeXGy0YBYqFEHTu5fibtLnpWWQOWmcg7dY=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=MBDtbNRiC/K9YJmsUzaU5YAJbCWDYupoe4TfsXPopoYEfSREmGEVsVqI+orWiDvw3 wAjv9iLFyT1tmQoxriXf1o2JCeZVcvoh1z1Ls4xSt8ru52b2FtlGPsE9P25OF2d8WY aDTudpLcKXf3Er4AYshbXPuVzRKJ66O1kO8DwW/I= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id A75AA3987C30 for ; Fri, 15 Jan 2021 20:10:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A75AA3987C30 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 10FK9jdo021954 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Jan 2021 15:09:50 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 10FK9jdo021954 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 283FC1E590; Fri, 15 Jan 2021 15:09:45 -0500 (EST) Subject: Re: [PATCH] use DISABLE_COPY_AND_ASSIGN in switch_thru_all_uis To: Lancelot SIX , gdb-patches@sourceware.org References: <20210115194950.16882-1-lsix@lancelotsix.com> Message-ID: <9f6bbdc6-efe8-3fb6-4d1c-bcbd381de778@polymtl.ca> Date: Fri, 15 Jan 2021 15:09:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210115194950.16882-1-lsix@lancelotsix.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 15 Jan 2021 20:09:45 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 2021-01-15 2:49 p.m., Lancelot SIX via Gdb-patches wrote: > In switch_thru_all_uis, a pre-c++11 way of removing copy constructor > and assignment operator is used. > > This patch uses the DISABLE_COPY_AND_ASSIGN macro which does the right > thing for pre and post c++11. > > gdb/Changelog: > > * top.h (switch_thru_all_uis): Use DISABLE_COPY_AND_ASSIGN. > --- > gdb/top.h | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/gdb/top.h b/gdb/top.h > index a31b19ae954..d912ea97190 100644 > --- a/gdb/top.h > +++ b/gdb/top.h > @@ -190,10 +190,7 @@ class switch_thru_all_uis > > private: > > - /* No need for these. They are intentionally not defined > - anywhere. */ > - switch_thru_all_uis &operator= (const switch_thru_all_uis &); > - switch_thru_all_uis (const switch_thru_all_uis &); > + DISABLE_COPY_AND_ASSIGN (switch_thru_all_uis); > > /* Used to iterate through the UIs. */ > struct ui *m_iter; > Thanks, this LGTM. Maybe just move the DISABLE_COPY_AND_ASSIGN so it's right below the constructor (it no longer needs to be in the private section, given we know we are using C++ >= 11). Simon