[glibmm] ConstructParams: Remove copy constructor.



commit 2f9b851a976a9bd452201128a151598f9969756b
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Apr 6 11:13:11 2017 +0200

    ConstructParams: Remove copy constructor.
    
    I doubt that this is really necessary with C++11.
    Please file a bug if this causes a real compilation problem.

 glib/glibmm/object.cc |   27 ---------------------------
 glib/glibmm/object.h  |    7 +------
 2 files changed, 1 insertions(+), 33 deletions(-)
---
diff --git a/glib/glibmm/object.cc b/glib/glibmm/object.cc
index 7f77072..173d30e 100644
--- a/glib/glibmm/object.cc
+++ b/glib/glibmm/object.cc
@@ -133,33 +133,6 @@ ConstructParams::~ConstructParams() noexcept
   g_free(parameter_values);
 }
 
-/*
- * Some compilers require the existence of a copy constructor in certain
- * usage contexts.  This implementation is fully functional, but unlikely
- * to be ever actually called due to optimization.
- */
-ConstructParams::ConstructParams(const ConstructParams& other)
-: glibmm_class(other.glibmm_class),
-  n_parameters(other.n_parameters),
-  parameter_names(g_new(const char*, n_parameters)),
-  parameter_values(g_new(GValue, n_parameters))
-{
-  for (unsigned int i = 0; i < n_parameters; ++i)
-  {
-    auto& param_name = parameter_names[i];
-    auto& param_value = parameter_values[i];
-
-    auto& other_param_name = other.parameter_names[i];
-    auto& other_param_value = other.parameter_values[i];
-
-    param_name = other_param_name;
-    param_value.g_type = 0;
-
-    g_value_init(&param_value, G_VALUE_TYPE(&other_param_value));
-    g_value_copy(&other_param_value, &param_value);
-  }
-}
-
 /**** Glib::Object_Class ***************************************************/
 
 const Glib::Class&
diff --git a/glib/glibmm/object.h b/glib/glibmm/object.h
index e3df1b4..2496aea 100644
--- a/glib/glibmm/object.h
+++ b/glib/glibmm/object.h
@@ -80,12 +80,7 @@ public:
     ...) G_GNUC_NULL_TERMINATED; // warn if called without a trailing NULL pointer
   ~ConstructParams() noexcept;
 
-  // The copy constructor is semantically required by the C++ compiler
-  // (since g++ 3.4) to be able to create temporary instances, depending
-  // on the usage context.  Apparently the compiler will actually optimize
-  // away the copy, though.  See bug #132300.
-  ConstructParams(const ConstructParams& other);
-
+  ConstructParams(const ConstructParams& other) = delete;
   ConstructParams& operator=(const ConstructParams&) = delete;
 };
 


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