mirror of
https://github.com/AxioDL/boo.git
synced 2025-05-16 12:21:25 +00:00
Add equality operators to ObjectToken
This commit is contained in:
parent
1e67f49b0b
commit
daca17e866
@ -70,6 +70,8 @@ public:
|
|||||||
return static_cast<T*>(m_obj);
|
return static_cast<T*>(m_obj);
|
||||||
}
|
}
|
||||||
explicit operator bool() const noexcept { return m_obj != nullptr; }
|
explicit operator bool() const noexcept { return m_obj != nullptr; }
|
||||||
|
constexpr bool operator==(const ObjToken<SubCls>& other) const noexcept { return m_obj == other.m_obj; }
|
||||||
|
constexpr bool operator!=(const ObjToken<SubCls>& other) const noexcept { return !(*this == other); }
|
||||||
void reset() noexcept {
|
void reset() noexcept {
|
||||||
if (m_obj)
|
if (m_obj)
|
||||||
m_obj->decrement();
|
m_obj->decrement();
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <thread>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user