fix: use const qualifier for operator==() and allow other comparisons
This fixes an implicit behavior changed by C++17. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
1a6cb9ee99
commit
6fe55a79f1
@ -77,10 +77,12 @@ public:
|
|||||||
{
|
{
|
||||||
return m_ptr;
|
return m_ptr;
|
||||||
}
|
}
|
||||||
bool operator==(const shared_qobject_ptr<T>& other) {
|
template<typename U>
|
||||||
|
bool operator==(const shared_qobject_ptr<U>& other) const {
|
||||||
return m_ptr == other.m_ptr;
|
return m_ptr == other.m_ptr;
|
||||||
}
|
}
|
||||||
bool operator!=(const shared_qobject_ptr<T>& other) {
|
template<typename U>
|
||||||
|
bool operator!=(const shared_qobject_ptr<U>& other) const {
|
||||||
return m_ptr != other.m_ptr;
|
return m_ptr != other.m_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user