use DISABLE_COPY_AND_ASSIGN in switch_thru_all_uis
authorLancelot SIX <lsix@lancelotsix.com>
Fri, 15 Jan 2021 19:35:36 +0000 (19:35 +0000)
committerLancelot SIX <lsix@lancelotsix.com>
Tue, 19 Jan 2021 22:49:12 +0000 (22:49 +0000)
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:

2021-01-19  Lancelot SIX  <lsix@lancelotsix.com>

* top.h (switch_thru_all_uis): Use DISABLE_COPY_AND_ASSIGN.

gdb/ChangeLog
gdb/top.h

index 3c8379c50dda19aaa5d04dd1067b92ecd7f673e4..8a9507223a518d956c296b442fc12f2ff348b24e 100644 (file)
@@ -1,3 +1,7 @@
+2021-01-19  Lancelot SIX  <lsix@lancelotsix.com>
+
+       * top.h (switch_thru_all_uis): Use DISABLE_COPY_AND_ASSIGN.
+
 2021-01-19  Luis Machado  <luis.machado@linaro.org>
 
        * trad-frame.h (trad_frame_saved_reg) <set_value_bytes>: Allocate
index a31b19ae9542508e59057304d48a07dcf9f362fb..f58bebbb385bdcbf2c11491e07d6a53aee949dd0 100644 (file)
--- a/gdb/top.h
+++ b/gdb/top.h
@@ -173,6 +173,8 @@ public:
     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 @@ public:
 
  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;