From 965aa0d083c57ec1ea36dc13df5f43c341879064 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Fri, 2 Dec 2005 12:25:47 +0000 Subject: [PATCH] Added toStrong() on weak ref. --- vmime/utility/smartPtr.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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 toStrong() + { + if (m_ptr == NULL) + return ref (); + + return ref ::fromPtr(m_ptr); + } + // Implicit non-const => const conversion operator weak_ref () const {