[glibmm] gmmproc: _CLASS_OPAQUE_COPYABLE: Generate static swap().



commit d63be4dae0174fc85b4236a85c64fde51faadead
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Aug 22 12:35:36 2015 +0200

    gmmproc: _CLASS_OPAQUE_COPYABLE: Generate static swap().
    
    As in _CLASS_BOXEDTYPE().
    This can then be used by std::swap(), used by standard containers.

 tools/m4/class_opaque_copyable.m4 |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/tools/m4/class_opaque_copyable.m4 b/tools/m4/class_opaque_copyable.m4
index 5873925..ed9b559 100644
--- a/tools/m4/class_opaque_copyable.m4
+++ b/tools/m4/class_opaque_copyable.m4
@@ -41,6 +41,17 @@ define(`_END_CLASS_OPAQUE_COPYABLE',`
 
 _SECTION(SECTION_HEADER3)
 
+__NAMESPACE_BEGIN__
+
+/** @relates __NAMESPACE__::__CPPNAME__
+ * @param lhs The left-hand side
+ * @param rhs The right-hand side
+ */
+inline void swap(__CPPNAME__& lhs, __CPPNAME__& rhs) noexcept
+  { lhs.swap(rhs); }
+
+__NAMESPACE_END__
+
 ifdef(`__BOOL_NO_WRAP_FUNCTION__',`dnl
 ',`dnl else
 namespace Glib


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