diff options
author | Olli Salli <ollisal@gmail.com> | 2010-08-29 11:06:24 +0300 |
---|---|---|
committer | Olli Salli <ollisal@gmail.com> | 2010-09-10 08:55:04 +0300 |
commit | 6a7f9ce2d7afd5a31d22af05fbc5e51df7695fc0 (patch) | |
tree | 6b148d659cc54d4915618d1ac228b32235e057b5 | |
parent | 69a8fbdb4ca065685196f067154e3e3ad132ce99 (diff) |
Add an upcasting ctor to SharedPtr
-rw-r--r-- | TelepathyQt4/shared-ptr.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/TelepathyQt4/shared-ptr.h b/TelepathyQt4/shared-ptr.h index 2bdb4f77..5644e880 100644 --- a/TelepathyQt4/shared-ptr.h +++ b/TelepathyQt4/shared-ptr.h @@ -70,6 +70,8 @@ class SharedPtr public: inline SharedPtr() : d(0) { } explicit inline SharedPtr(T *d) : d(d) { if (d) { d->ref(); } } + template <typename Subclass> + inline SharedPtr(const SharedPtr<Subclass> &o) : d(o.data()) { if (d) { d->ref(); } } inline SharedPtr(const SharedPtr<T> &o) : d(o.d) { if (d) { d->ref(); } } explicit inline SharedPtr(const WeakPtr<T> &o) { |