util/{Const,Writable}Buffer: eliminate static method Null(), use nullptr cast instead
This commit is contained in:
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
AllocatedArray(AllocatedArray &&other)
|
||||
:buffer(other.buffer) {
|
||||
other.buffer = Buffer::Null();
|
||||
other.buffer = nullptr;
|
||||
}
|
||||
|
||||
~AllocatedArray() {
|
||||
|
@@ -60,10 +60,6 @@ struct ConstBuffer<void> {
|
||||
constexpr ConstBuffer(pointer_type _data, size_type _size)
|
||||
:data(_data), size(_size) {}
|
||||
|
||||
constexpr static ConstBuffer Null() {
|
||||
return ConstBuffer(nullptr, 0);
|
||||
}
|
||||
|
||||
constexpr static ConstBuffer<void> FromVoid(ConstBuffer<void> other) {
|
||||
return other;
|
||||
}
|
||||
@@ -120,10 +116,6 @@ struct ConstBuffer {
|
||||
constexpr ConstBuffer(const T (&_data)[_size])
|
||||
:data(_data), size(_size) {}
|
||||
|
||||
constexpr static ConstBuffer Null() {
|
||||
return ConstBuffer(nullptr, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cast a ConstBuffer<void> to a ConstBuffer<T>, rounding down
|
||||
* to the next multiple of T's size.
|
||||
|
@@ -60,10 +60,6 @@ struct WritableBuffer<void> {
|
||||
constexpr WritableBuffer(pointer_type _data, size_type _size)
|
||||
:data(_data), size(_size) {}
|
||||
|
||||
constexpr static WritableBuffer Null() {
|
||||
return { nullptr, 0 };
|
||||
}
|
||||
|
||||
constexpr bool IsNull() const {
|
||||
return data == nullptr;
|
||||
}
|
||||
@@ -114,10 +110,6 @@ struct WritableBuffer {
|
||||
constexpr WritableBuffer(T (&_data)[_size])
|
||||
:data(_data), size(_size) {}
|
||||
|
||||
constexpr static WritableBuffer Null() {
|
||||
return { nullptr, 0 };
|
||||
}
|
||||
|
||||
/**
|
||||
* Cast a WritableBuffer<void> to a WritableBuffer<T>,
|
||||
* rounding down to the next multiple of T's size.
|
||||
|
Reference in New Issue
Block a user