Commit 2670e13c authored by Max Kellermann's avatar Max Kellermann

util/{Const,Writable}Buffer: add static_assert to FromVoid()

parent 49784513
......@@ -144,6 +144,7 @@ struct ConstBuffer {
constexpr
#endif
static ConstBuffer<T> FromVoid(ConstBuffer<void> other) {
static_assert(sizeof(T) > 0, "Empty base type");
#ifndef NDEBUG
assert(other.size % sizeof(T) == 0);
#endif
......
......@@ -138,6 +138,7 @@ struct WritableBuffer {
constexpr
#endif
static WritableBuffer<T> FromVoid(WritableBuffer<void> other) {
static_assert(sizeof(T) > 0, "Empty base type");
#ifndef NDEBUG
assert(other.size % sizeof(T) == 0);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment