summaryrefslogtreecommitdiff
path: root/glib
diff options
context:
space:
mode:
Diffstat (limited to 'glib')
-rw-r--r--glib/glibmm/refptr.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/glib/glibmm/refptr.h b/glib/glibmm/refptr.h
index 981dd796..74ed0413 100644
--- a/glib/glibmm/refptr.h
+++ b/glib/glibmm/refptr.h
@@ -42,7 +42,7 @@ namespace Glib
* RefPtr<> can store any class that has reference() and unreference() methods,
* and whose destructor is noexcept (the default for destructors).
* In gtkmm, that is anything derived from Glib::ObjectBase, such as
- * Gdk::Pixmap.
+ * Gdk::Pixbuf.
*
* See the "Memory Management" section in the "Programming with gtkmm"
* book for further information.
@@ -136,7 +136,7 @@ public:
template <class T_CastFrom>
inline RefPtr& operator=(RefPtr<T_CastFrom>&& src) noexcept;
- /** Copy from different, but castable type).
+ /** Copy from different, but castable type.
*
* Increments the reference count.
*/
@@ -156,6 +156,12 @@ public:
*/
inline T_CppObject* operator->() const noexcept;
+ /** Returns the stored pointer.
+ *
+ * @newin{2,56}
+ */
+ inline T_CppObject* get() const noexcept;
+
/** Test whether the RefPtr<> points to any underlying instance.
*
* Mimics usage of ordinary pointers:
@@ -396,6 +402,12 @@ RefPtr<T_CppObject>::operator!=(const RefPtr& src) const noexcept
}
template <class T_CppObject>
+inline T_CppObject* RefPtr<T_CppObject>::get() const noexcept
+{
+ return pCppObject_;
+}
+
+template <class T_CppObject>
inline RefPtr<T_CppObject>::operator bool() const noexcept
{
return (pCppObject_ != nullptr);