mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 10:32:56 +01:00
AutoPtr and SharedPtr comparison with nullptr
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "Poco/Exception.h"
|
||||
#include "Poco/AtomicCounter.h"
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace Poco {
|
||||
@@ -336,6 +337,11 @@ public:
|
||||
return get() == ptr;
|
||||
}
|
||||
|
||||
bool operator == (std::nullptr_t ptr) const
|
||||
{
|
||||
return get() == ptr;
|
||||
}
|
||||
|
||||
bool operator != (const SharedPtr& ptr) const
|
||||
{
|
||||
return get() != ptr.get();
|
||||
@@ -351,6 +357,11 @@ public:
|
||||
return get() != ptr;
|
||||
}
|
||||
|
||||
bool operator != (std::nullptr_t ptr) const
|
||||
{
|
||||
return get() != ptr;
|
||||
}
|
||||
|
||||
bool operator < (const SharedPtr& ptr) const
|
||||
{
|
||||
return get() < ptr.get();
|
||||
|
||||
Reference in New Issue
Block a user