AutoPtr and SharedPtr comparison with nullptr

This commit is contained in:
Günter Obiltschnig
2020-02-07 18:13:22 +01:00
parent 500b8f93ab
commit e51449e159
4 changed files with 57 additions and 27 deletions

View File

@@ -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();