Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Lancelot SIX via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Cc: Lancelot SIX <lsix@lancelotsix.com>
Subject: [PATCH v2] use DISABLE_COPY_AND_ASSIGN in switch_thru_all_uis
Date: Fri, 15 Jan 2021 21:28:42 +0000	[thread overview]
Message-ID: <20210115212842.24317-1-lsix@lancelotsix.com> (raw)
In-Reply-To: <20210115194950.16882-1-lsix@lancelotsix.com>

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;
 
-- 
2.29.2


  parent reply	other threads:[~2021-01-15 21:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 19:49 [PATCH] " Lancelot SIX via Gdb-patches
2021-01-15 20:09 ` Simon Marchi via Gdb-patches
2021-01-15 21:28 ` Lancelot SIX via Gdb-patches [this message]
2021-01-15 21:38   ` [PATCH v2] " Simon Marchi via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210115212842.24317-1-lsix@lancelotsix.com \
    --to=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox