diff options
Diffstat (limited to 'common/ptr.h')
-rw-r--r-- | common/ptr.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/common/ptr.h b/common/ptr.h index cad23a18ff..1121ffd665 100644 --- a/common/ptr.h +++ b/common/ptr.h @@ -62,7 +62,7 @@ namespace Common { * The class has implicit upcast support, so if you got a class B derived * from class A, you can assign a pointer to B without any problems to a * SharedPtr object with template parameter A. The very same applies to - * assigment of a SharedPtr<B> object to a SharedPtr<A> object. + * assignment of a SharedPtr<B> object to a SharedPtr<A> object. * * There are also operators != and == to compare two SharedPtr objects * with compatible pointers. @@ -116,6 +116,10 @@ public: */ Pointer get() const { return _pointer; } + /** + * Implicit conversion operator to bool for convenience, to make + * checks like "if (sharePtr) ..." possible. + */ operator bool() const { return _pointer != 0; } /** |