Fix: inline ESPHOME_DEBUG_ASSERT to avoid include order issue

This commit is contained in:
J. Nick Koston
2026-03-27 16:27:44 -10:00
parent ae2a82edd6
commit 4eec3f5076
+3 -1
View File
@@ -501,7 +501,9 @@ template<typename T, size_t MAX_CAPACITY = std::numeric_limits<uint16_t>::max()>
/// falls back to element-wise copy for non-trivially copyable types (e.g. TemplatableValue).
/// N is set by code generation; ESPHOME_DEBUG_ASSERT catches mismatches in debug/integration tests.
template<typename T, size_t N> inline void init_array_from(std::array<T, N> &dest, std::initializer_list<T> src) {
ESPHOME_DEBUG_ASSERT(src.size() == N);
#ifdef ESPHOME_DEBUG
assert(src.size() == N);
#endif
if constexpr (std::is_trivially_copyable_v<T>) {
__builtin_memcpy(dest.data(), src.begin(), N * sizeof(T));
} else {