util/{Const,Writable}Buffer: add static_assert to FromVoid()
This commit is contained in:
parent
49784513b1
commit
2670e13cbd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue