util/WritableBuffer: add WritableBuffer<void>::{FromVoid,ToVoid}()

This commit is contained in:
Max Kellermann 2021-09-01 16:19:01 +02:00 committed by Max Kellermann
parent 8d679e7e00
commit a15c1c71d5

View File

@ -58,6 +58,14 @@ struct WritableBuffer<void> {
constexpr WritableBuffer(pointer _data, size_type _size) noexcept
:data(_data), size(_size) {}
constexpr static WritableBuffer<void> FromVoid(WritableBuffer<void> other) noexcept {
return other;
}
constexpr WritableBuffer<void> ToVoid() const noexcept {
return *this;
}
constexpr operator ConstBuffer<void>() const noexcept {
return {data, size};
}