[glibmm/glibmm-2-68] Declare some copy assignment operators deleted (=delete)



commit 7b974f2edc828f07d8671df1cec246952c5f1561
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Fri Aug 27 11:09:17 2021 +0200

    Declare some copy assignment operators deleted (=delete)
    
    Avoid warnings from the clang++ compiler.
    
    It's deprecated in C++ to implicitly declare a copy constructor, if there
    is a user-defined copy assignment operator. Instead of declaring copy
    assignment operators private without implementation, declare them deleted.

 gio/giomm/socketsource.h |  2 +-
 glib/glibmm/main.h       | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/gio/giomm/socketsource.h b/gio/giomm/socketsource.h
index 477e0e3d..596beba9 100644
--- a/gio/giomm/socketsource.h
+++ b/gio/giomm/socketsource.h
@@ -82,7 +82,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalSocket& operator=(const SignalSocket&);
+  SignalSocket& operator=(const SignalSocket&) = delete;
 };
 
 /** Convenience socket signal.
diff --git a/glib/glibmm/main.h b/glib/glibmm/main.h
index 4dda91b6..5e57c5ba 100644
--- a/glib/glibmm/main.h
+++ b/glib/glibmm/main.h
@@ -190,7 +190,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalTimeout& operator=(const SignalTimeout&);
+  SignalTimeout& operator=(const SignalTimeout&) = delete;
 };
 
 class GLIBMM_API SignalIdle
@@ -248,7 +248,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalIdle& operator=(const SignalIdle&);
+  SignalIdle& operator=(const SignalIdle&) = delete;
 };
 
 class GLIBMM_API SignalIO
@@ -319,7 +319,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalIO& operator=(const SignalIO&);
+  SignalIO& operator=(const SignalIO&) = delete;
 };
 
 class GLIBMM_API SignalChildWatch
@@ -350,7 +350,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalChildWatch& operator=(const SignalChildWatch&);
+  SignalChildWatch& operator=(const SignalChildWatch&) = delete;
 };
 
 /** Convenience timeout signal.
@@ -693,8 +693,9 @@ private:
   MainLoop();
   void operator delete(void*, std::size_t);
 
-  MainLoop(const MainLoop&);
-  MainLoop& operator=(const MainLoop&);
+  // noncopyable
+  MainLoop(const MainLoop&) = delete;
+  MainLoop& operator=(const MainLoop&) = delete;
 };
 
 /** @relates Glib::MainLoop */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]