Skip to content

Commit

Permalink
[Core] Make ProxyType comparable with nullptr (#1622)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Wielders <[email protected]>
  • Loading branch information
sebaszm and pwielders authored Jun 1, 2024
1 parent 460011c commit 283b3d5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/com/Administrator.h
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ namespace RPC {
InvokeServer& operator=(InvokeServer&&) = delete;
InvokeServer& operator=(const InvokeServer&) = delete;

InvokeServer(Core::IWorkerPool* workers)
explicit InvokeServer(Core::IWorkerPool* workers)
: _threadPoolEngine(*workers)
{
ASSERT(workers != nullptr);
Expand Down
10 changes: 8 additions & 2 deletions Source/core/Proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,6 @@ POP_WARNING()
{
return (_refCount == a_RHS._refCount);
}

inline bool operator!=(const ProxyType<CONTEXT>& a_RHS) const
{
return !(operator==(a_RHS));
Expand All @@ -534,11 +533,18 @@ POP_WARNING()
{
return ((_refCount != nullptr) && (_realObject == &a_RHS));
}

inline bool operator!=(const CONTEXT& a_RHS) const
{
return (!operator==(a_RHS));
}
inline bool operator==(const nullptr_t&) const
{
return (_refCount == nullptr);
}
inline bool operator!=(const nullptr_t&) const
{
return (_refCount != nullptr);
}

inline CONTEXT* operator->() const
{
Expand Down

0 comments on commit 283b3d5

Please sign in to comment.