[glibmm/gmmproc-refactor] Add an unwrap_copy overload for references.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/gmmproc-refactor] Add an unwrap_copy overload for references.
- Date: Sun, 22 Jul 2012 18:15:50 +0000 (UTC)
commit 0a8d991b175a3ec8d81539ccae4ee8f61dcf7b2b
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Sun Jul 22 15:59:26 2012 +0200
Add an unwrap_copy overload for references.
It is provided mainly for consistency - it simply calls gobj_copy()
method.
glib/glibmm/wrap.h | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/glib/glibmm/wrap.h b/glib/glibmm/wrap.h
index 3d4eb74..cf216fe 100644
--- a/glib/glibmm/wrap.h
+++ b/glib/glibmm/wrap.h
@@ -160,6 +160,15 @@ const typename T::BaseObjectType* unwrap(const Glib::RefPtr<const T>& ptr)
}
/** Get the underlying C instance from the C++ instance and acquire a
+ * reference.
+ */
+template <class T> inline
+typename T::BaseObjectType* unwrap_copy(const T& ref)
+{
+ return ref.gobj_copy();
+}
+
+/** Get the underlying C instance from the C++ instance and acquire a
* reference. This is just like calling gobj_copy(), but it does its own
* check for a NULL pointer.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]