public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] use DISABLE_COPY_AND_ASSIGN in switch_thru_all_uis
@ 2021-01-15 19:49 Lancelot SIX
  2021-01-15 20:09 ` Simon Marchi
  2021-01-15 21:28 ` [PATCH v2] " Lancelot SIX
  0 siblings, 2 replies; 4+ messages in thread
From: Lancelot SIX @ 2021-01-15 19:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: Lancelot SIX

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-15 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 19:49 [PATCH] use DISABLE_COPY_AND_ASSIGN in switch_thru_all_uis Lancelot SIX
2021-01-15 20:09 ` Simon Marchi
2021-01-15 21:28 ` [PATCH v2] " Lancelot SIX
2021-01-15 21:38   ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).