[glibmm] gmmproc: _CLASS_BOXEDTYPE_STATIC(): Add move operations.



commit 3d9098867b33917304191cba78d8980430f00941
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Aug 22 12:31:49 2015 +0200

    gmmproc: _CLASS_BOXEDTYPE_STATIC(): Add move operations.
    
    Roughly as in _CLASS_BOXEDTYPE().

 tools/m4/class_boxedtype_static.m4 |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/tools/m4/class_boxedtype_static.m4 b/tools/m4/class_boxedtype_static.m4
index c265a0e..ada3758 100644
--- a/tools/m4/class_boxedtype_static.m4
+++ b/tools/m4/class_boxedtype_static.m4
@@ -99,6 +99,21 @@ dnl
 dnl The implementation:
 dnl
 
+__CPPNAME__::__CPPNAME__`'(__CPPNAME__&& other) noexcept
+:
+  gobject_(std::move(other.gobject_))
+{
+  //We could wipe other.gobject_ via memset,
+  //but that is not really necessary:
+  //other.gobject_ = nullptr;
+}
+
+__CPPNAME__& __CPPNAME__::operator=(__CPPNAME__`'&& other) noexcept
+{
+  gobject_ = std::move(other.gobject_);
+  return *this;
+}
+
 dnl // static
 dnl const __CNAME__ __CPPNAME__::gobject_initializer_ = { 0, };
 dnl
@@ -145,6 +160,9 @@ public:
   typedef __CNAME__ BaseObjectType;
 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
+  __CPPNAME__`'(__CPPNAME__&& other) noexcept;
+  __CPPNAME__& operator=(__CPPNAME__&& other) noexcept;
+
   /** Get the GType for this class, for use with the underlying GObject type system.
    */
   static GType get_type() G_GNUC_CONST;


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