[glibmm] C++11: _CLASS_BOXEDTYPE: Generate move constructors and assignment operators.



commit 1b23397544bd031331b3110be1b790659bdceb24
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jul 9 23:17:54 2015 +0200

    C++11: _CLASS_BOXEDTYPE: Generate move constructors and assignment operators.
    
    Bug #751432

 tools/m4/class_boxedtype.m4 |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/tools/m4/class_boxedtype.m4 b/tools/m4/class_boxedtype.m4
index 1a9b731..fc46097 100644
--- a/tools/m4/class_boxedtype.m4
+++ b/tools/m4/class_boxedtype.m4
@@ -135,6 +135,20 @@ __CPPNAME__::__CPPNAME__`'(const __CPPNAME__& other)
   gobject_ ((other.gobject_) ? __BOXEDTYPE_FUNC_COPY`'(other.gobject_) : 0)
 {}
 
+__CPPNAME__::__CPPNAME__`'(__CPPNAME__&& other)
+:
+  gobject_(other.gobject_)
+{
+  other.gobject_ = 0;
+}
+
+__CPPNAME__& __CPPNAME__::operator=(__CPPNAME__`'&& other)
+{
+  __CPPNAME__ temp (other);
+  swap(temp);
+  return *this;
+}
+
 ifdef(`__BOOL_CUSTOM_CTOR_CAST__',,`dnl else
 __CPPNAME__::__CPPNAME__`'(__CNAME__* gobject, bool make_a_copy)
 :
@@ -208,6 +222,9 @@ ifdef(`__BOOL_CUSTOM_CTOR_CAST__',,`dnl else
   __CPPNAME__`'(const __CPPNAME__& other);
   __CPPNAME__& operator=(const __CPPNAME__& other);
 
+  __CPPNAME__`'(__CPPNAME__&& other);
+  __CPPNAME__& operator=(__CPPNAME__&& other);
+
 _IMPORT(SECTION_DTOR_DOCUMENTATION)
   ~__CPPNAME__`'();
 


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