util/{Const,Writable}Buffer: add operator==(nullptr_t)
This commit is contained in:
@@ -100,6 +100,14 @@ public:
|
|||||||
return buffer.IsNull();
|
return buffer.IsNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool operator==(std::nullptr_t) const {
|
||||||
|
return buffer == nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool operator!=(std::nullptr_t) const {
|
||||||
|
return buffer != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if no memory was allocated so far.
|
* Returns true if no memory was allocated so far.
|
||||||
*/
|
*/
|
||||||
|
@@ -76,6 +76,14 @@ struct ConstBuffer<void> {
|
|||||||
return data == nullptr;
|
return data == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool operator==(std::nullptr_t) const {
|
||||||
|
return data == nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool operator!=(std::nullptr_t) const {
|
||||||
|
return data != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr bool IsEmpty() const {
|
constexpr bool IsEmpty() const {
|
||||||
return size == 0;
|
return size == 0;
|
||||||
}
|
}
|
||||||
@@ -143,6 +151,14 @@ struct ConstBuffer {
|
|||||||
return data == nullptr;
|
return data == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool operator==(std::nullptr_t) const {
|
||||||
|
return data == nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool operator!=(std::nullptr_t) const {
|
||||||
|
return data != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr bool IsEmpty() const {
|
constexpr bool IsEmpty() const {
|
||||||
return size == 0;
|
return size == 0;
|
||||||
}
|
}
|
||||||
|
@@ -68,6 +68,14 @@ struct WritableBuffer<void> {
|
|||||||
return data == nullptr;
|
return data == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool operator==(std::nullptr_t) const {
|
||||||
|
return data == nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool operator!=(std::nullptr_t) const {
|
||||||
|
return data != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr bool IsEmpty() const {
|
constexpr bool IsEmpty() const {
|
||||||
return size == 0;
|
return size == 0;
|
||||||
}
|
}
|
||||||
@@ -137,6 +145,14 @@ struct WritableBuffer {
|
|||||||
return data == nullptr;
|
return data == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr bool operator==(std::nullptr_t) const {
|
||||||
|
return data == nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr bool operator!=(std::nullptr_t) const {
|
||||||
|
return data != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
constexpr bool IsEmpty() const {
|
constexpr bool IsEmpty() const {
|
||||||
return size == 0;
|
return size == 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user