From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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> From: Simon Marchi 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-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 15 Jan 2021 21:39:12 -0000 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