aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-12-02 12:25:47 +0000
committerVincent Richard <[email protected]>2005-12-02 12:25:47 +0000
commit965aa0d083c57ec1ea36dc13df5f43c341879064 (patch)
tree25e7022f24cd8775f3c9b9b5a532dcaf3dda877b
parentFixed typo in CXXFLAGS/debug. (diff)
downloadvmime-965aa0d083c57ec1ea36dc13df5f43c341879064.tar.gz
vmime-965aa0d083c57ec1ea36dc13df5f43c341879064.zip
Added toStrong() on weak ref.
-rw-r--r--vmime/utility/smartPtr.hpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/vmime/utility/smartPtr.hpp b/vmime/utility/smartPtr.hpp
index 411983f3..1c1a1d20 100644
--- a/vmime/utility/smartPtr.hpp
+++ b/vmime/utility/smartPtr.hpp
@@ -475,6 +475,14 @@ public:
return *this;
}
+ ref <T> toStrong()
+ {
+ if (m_ptr == NULL)
+ return ref <T>();
+
+ return ref <T>::fromPtr(m_ptr);
+ }
+
// Implicit non-const => const conversion
operator weak_ref <const T>() const
{