Allow comparing rcp<T> to rcp<U>
This commit is contained in:
1 parent
11555ded36
commit
69ecab39f2
2 files changed
+18
-4
No files matched your search
+6
-4
@@ -147,14 +147,16 @@ public:
|
||||
return ptr != nullptr;
|
||||
}
|
||||
|
||||
bool operator==(const rcp & other) const
|
||||
template <typename U>
|
||||
bool operator==(const rcp<U> & other) const
|
||||
{
|
||||
return ptr == other.ptr;
|
||||
return static_cast<const void *>(ptr) == static_cast<const void *>(other.ptr);
|
||||
}
|
||||
|
||||
bool operator!=(const rcp & other) const
|
||||
template <typename U>
|
||||
bool operator!=(const rcp<U> & other) const
|
||||
{
|
||||
return ptr != other.ptr;
|
||||
return static_cast<const void *>(ptr) != static_cast<const void *>(other.ptr);
|
||||
}
|
||||
|
||||
bool operator==(std::nullptr_t) const
|
||||
|
||||
Reference in new issue
Block a user