util/{Const,Writable}Buffer: add operator==(nullptr_t)
This commit is contained in:
parent
8753e558f2
commit
e5c9b4cd75
|
@ -100,6 +100,14 @@ public:
|
|||
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.
|
||||
*/
|
||||
|
|
|
@ -76,6 +76,14 @@ struct ConstBuffer<void> {
|
|||
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 {
|
||||
return size == 0;
|
||||
}
|
||||
|
@ -143,6 +151,14 @@ struct ConstBuffer {
|
|||
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 {
|
||||
return size == 0;
|
||||
}
|
||||
|
|
|
@ -68,6 +68,14 @@ struct WritableBuffer<void> {
|
|||
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 {
|
||||
return size == 0;
|
||||
}
|
||||
|
@ -137,6 +145,14 @@ struct WritableBuffer {
|
|||
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 {
|
||||
return size == 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue