diff --git a/Code/Misc/Utilities-InlineImpl.h b/Code/Misc/Utilities-InlineImpl.h index c2bbd2a9..6cc99aab 100644 --- a/Code/Misc/Utilities-InlineImpl.h +++ b/Code/Misc/Utilities-InlineImpl.h @@ -98,6 +98,18 @@ namespace Utility return this->ownedInstance != NULL; } + template + bool UniquePointer::operator == ( Type *stray ) const + { + return this->ownedInstance == stray; + } + + template + bool UniquePointer::operator != ( Type *stray ) const + { + return this->ownedInstance != stray; + } + template Type* UniquePointer::Release() { @@ -165,6 +177,18 @@ namespace Utility return this->ownedArray != NULL; } + template + bool UniqueArray::operator == ( Type *stray ) const + { + return this->ownedArray == stray; + } + + template + bool UniqueArray::operator != ( Type *stray ) const + { + return this->ownedArray != stray; + } + template Type* UniqueArray::Release() { diff --git a/Code/Misc/Utilities.h b/Code/Misc/Utilities.h index 66164e19..59d5042d 100644 --- a/Code/Misc/Utilities.h +++ b/Code/Misc/Utilities.h @@ -60,6 +60,12 @@ namespace Utility //! If true, this UniquePointer have a current ownership/responsibility of a dynamic instance. operator bool () const; + //! @return true if this ownedInstance matches with stray + bool operator == ( Type *stray ) const; + + //! @return false if this ownedInstance matches with stray + bool operator != ( Type *stray ) const; + //! This UniquePointer drops all claims of ownership/responsibility and returns the dynamic instance. Now it is your responsibility to delete. Type* Release(); @@ -104,6 +110,12 @@ namespace Utility //! If true, this UniqueArray have a current ownership/responsibility of a dynamic instance. operator bool () const; + //! @return true if this ownedInstance matches with stray + bool operator == ( Type *stray ) const; + + //! @return false if this ownedInstance matches with stray + bool operator != ( Type *stray ) const; + //! This UniqueArray drops all claims of ownership/responsibility and returns the dynamic array. Now it is your responsibility to delete. Type* Release();