mirror of
				https://github.com/pocoproject/poco.git
				synced 2025-10-28 11:31:53 +01:00 
			
		
		
		
	AutoPtr and SharedPtr comparison with nullptr
This commit is contained in:
		| @@ -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; | ||||
|   | ||||
| @@ -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
	 Günter Obiltschnig
					Günter Obiltschnig