From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /8jOCoMLAmD5SgAAWB0awg (envelope-from ) for ; Fri, 15 Jan 2021 16:39:15 -0500 Received: by simark.ca (Postfix, from userid 112) id 165071EF80; Fri, 15 Jan 2021 16:39:15 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 6C30A1E945 for ; Fri, 15 Jan 2021 16:39:14 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BCBA5398B149; Fri, 15 Jan 2021 21:39:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCBA5398B149 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610746753; bh=TxRoKczt5XvKomdI5JU9rYymKyBpGvDLhNCbhHVrQr0=; 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=E7j3DahhcBGHb7qPXDTN1o8ILytUHmBarQvIoim7oALaYsYcxecudlYFB91j6NcIF 6IN4/AiR+n9g2Kfklm1wcZy148FZeug1NVnuvaaqwGtRc3jNUeT8X8Ojghh64GPYRX apibHmCRNRVNP5mFVYFDXqSVESdQvuhj9LmgGRAA= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 1D91A398795F for ; Fri, 15 Jan 2021 21:39:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1D91A398795F 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 10FLc2qj031868 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 15 Jan 2021 16:38:07 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 10FLc2qj031868 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id BD4111E945; Fri, 15 Jan 2021 16:38:02 -0500 (EST) Subject: Re: [PATCH v2] use DISABLE_COPY_AND_ASSIGN in switch_thru_all_uis To: Lancelot SIX , gdb-patches@sourceware.org References: <20210115194950.16882-1-lsix@lancelotsix.com> <20210115212842.24317-1-lsix@lancelotsix.com> Message-ID: Date: Fri, 15 Jan 2021 16:38:02 -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: <20210115212842.24317-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 21:38:02 +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 4:28 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 | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/gdb/top.h b/gdb/top.h > index a31b19ae954..f58bebbb385 100644 > --- a/gdb/top.h > +++ b/gdb/top.h > @@ -173,6 +173,8 @@ class switch_thru_all_uis > current_ui = ui_list; > } > > + DISABLE_COPY_AND_ASSIGN (switch_thru_all_uis); > + > /* If done iterating, return true; otherwise return false. */ > bool done () const > { > @@ -190,11 +192,6 @@ 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 &); > - > /* Used to iterate through the UIs. */ > struct ui *m_iter; > > Thanks, this is ok. Simon