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



commit c09bd001834eddd296cbfda419b8815e63c24d8c
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Fri Aug 27 10:51:33 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 +++++++------
 glib/glibmm/signalproxy.h |  6 +++---
 3 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/gio/giomm/socketsource.h b/gio/giomm/socketsource.h
index 2e3e3b47..0c507a56 100644
--- a/gio/giomm/socketsource.h
+++ b/gio/giomm/socketsource.h
@@ -78,7 +78,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 9a0ba45b..c3bd7829 100644
--- a/glib/glibmm/main.h
+++ b/glib/glibmm/main.h
@@ -212,7 +212,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalTimeout& operator=(const SignalTimeout&);
+  SignalTimeout& operator=(const SignalTimeout&) = delete;
 };
 
 class GLIBMM_API SignalIdle
@@ -270,7 +270,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalIdle& operator=(const SignalIdle&);
+  SignalIdle& operator=(const SignalIdle&) = delete;
 };
 
 class GLIBMM_API SignalIO
@@ -341,7 +341,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalIO& operator=(const SignalIO&);
+  SignalIO& operator=(const SignalIO&) = delete;
 };
 
 class GLIBMM_API SignalChildWatch
@@ -372,7 +372,7 @@ private:
   GMainContext* context_;
 
   // no copy assignment
-  SignalChildWatch& operator=(const SignalChildWatch&);
+  SignalChildWatch& operator=(const SignalChildWatch&) = delete;
 };
 
 /** Convenience timeout signal.
@@ -744,8 +744,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 */
diff --git a/glib/glibmm/signalproxy.h b/glib/glibmm/signalproxy.h
index 93781b16..0a94e849 100644
--- a/glib/glibmm/signalproxy.h
+++ b/glib/glibmm/signalproxy.h
@@ -66,7 +66,7 @@ protected:
   ObjectBase* obj_;
 
 private:
-  SignalProxyBase& operator=(const SignalProxyBase&); // not implemented
+  SignalProxyBase& operator=(const SignalProxyBase&) = delete;
 };
 
 // Shared portion of a Signal without detail
@@ -139,7 +139,7 @@ private:
   sigc::slot_base& connect_impl_(GCallback callback, const sigc::slot_base& slot, bool after);
 
   // no copy assignment
-  SignalProxyNormal& operator=(const SignalProxyNormal&);
+  SignalProxyNormal& operator=(const SignalProxyNormal&) = delete;
 };
 
 /**** Glib::SignalProxy ***************************************************/
@@ -291,7 +291,7 @@ private:
   const Glib::ustring detailed_name_; // signal_name[::detail_name]
 
   // no copy assignment
-  SignalProxyDetailed& operator=(const SignalProxyDetailed&);
+  SignalProxyDetailed& operator=(const SignalProxyDetailed&) = delete;
 };
 
 /** Proxy for signals with any number of arguments and possibly a detailed name.


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