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

@@ -21,6 +21,7 @@
#include "Poco/Foundation.h"
#include "Poco/Exception.h"
#include <algorithm>
#include <cstddef>
namespace Poco {
@@ -306,6 +307,11 @@ public:
return _ptr == ptr;
}
bool operator == (std::nullptr_t ptr) const
{
return _ptr == ptr;
}
bool operator != (const AutoPtr& ptr) const
{
return _ptr != ptr._ptr;
@@ -321,6 +327,11 @@ public:
return _ptr != ptr;
}
bool operator != (std::nullptr_t ptr) const
{
return _ptr != ptr;
}
bool operator < (const AutoPtr& ptr) const
{
return _ptr < ptr._ptr;