diff --git a/src/util/VarSize.hxx b/src/util/VarSize.hxx index 72cbdbc0e..bc5507762 100644 --- a/src/util/VarSize.hxx +++ b/src/util/VarSize.hxx @@ -1,8 +1,7 @@ // SPDX-License-Identifier: BSD-2-Clause // author: Max Kellermann -#ifndef MPD_VAR_SIZE_HXX -#define MPD_VAR_SIZE_HXX +#pragma once #include #include @@ -21,13 +20,11 @@ * #T */ template +requires std::is_standard_layout_v [[gnu::malloc]] [[gnu::returns_nonnull]] T * NewVarSize(size_t declared_tail_size, size_t real_tail_size, Args&&... args) { - static_assert(std::is_standard_layout::value, - "Not standard-layout"); - /* determine the total size of this instance */ size_t size = sizeof(T) - declared_tail_size + real_tail_size; @@ -53,5 +50,3 @@ DeleteVarSize(T *instance) /* free memory */ free(instance); } - -#endif