mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
IntrusivePtr: remove ordering operators
These violate the C++ standard because comparing pointers to unrelated objects is undefined behavior.
This commit is contained in:
parent
08128b244f
commit
98b27a2ae8
1 changed files with 0 additions and 28 deletions
|
@ -243,24 +243,6 @@ bool operator!=(const T* x, const IntrusivePtr<T>& y) {
|
||||||
return x != y.get();
|
return x != y.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @relates IntrusivePtr
|
|
||||||
*/
|
|
||||||
template <class T>
|
|
||||||
bool operator<(const IntrusivePtr<T>& x, const T* y)
|
|
||||||
{
|
|
||||||
return x.get() < y;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @relates IntrusivePtr
|
|
||||||
*/
|
|
||||||
template <class T>
|
|
||||||
bool operator<(const T* x, const IntrusivePtr<T>& y)
|
|
||||||
{
|
|
||||||
return x < y.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
// -- comparison to intrusive pointer ------------------------------------------
|
// -- comparison to intrusive pointer ------------------------------------------
|
||||||
|
|
||||||
// Using trailing return type and decltype() here removes this function from
|
// Using trailing return type and decltype() here removes this function from
|
||||||
|
@ -286,13 +268,3 @@ auto operator!=(const IntrusivePtr<T>& x, const IntrusivePtr<U>& y)
|
||||||
return x.get() != y.get();
|
return x.get() != y.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @relates IntrusivePtr
|
|
||||||
*/
|
|
||||||
template <class T>
|
|
||||||
auto operator<(const IntrusivePtr<T>& x, const IntrusivePtr<T>& y)
|
|
||||||
-> decltype(x.get() < y.get())
|
|
||||||
{
|
|
||||||
return x.get() < y.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue