[core] Remove deprecated seq/gens templates (#16685)

This commit is contained in:
Jonathan Swoboda
2026-05-26 18:50:20 -04:00
committed by GitHub
parent 6c4a8a3245
commit f728cb4373
-21
View File
@@ -13,27 +13,6 @@
namespace esphome {
// C++20 std::index_sequence is now used for tuple unpacking
// Legacy seq<>/gens<> pattern deprecated but kept for backwards compatibility
// https://stackoverflow.com/questions/7858817/unpacking-a-tuple-to-call-a-matching-function-pointer/7858971#7858971
// Remove before 2026.6.0
// NOLINTBEGIN(readability-identifier-naming)
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
template<int...> struct ESPDEPRECATED("Use std::index_sequence instead. Removed in 2026.6.0", "2025.12.0") seq {};
template<int N, int... S>
struct ESPDEPRECATED("Use std::make_index_sequence instead. Removed in 2026.6.0", "2025.12.0") gens
: gens<N - 1, N - 1, S...> {};
template<int... S> struct gens<0, S...> { using type = seq<S...>; };
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
// NOLINTEND(readability-identifier-naming)
/// Function-pointer-only templatable storage (4 bytes on 32-bit).
/// Used by the TEMPLATABLE_VALUE macro for codegen-managed fields.
/// Codegen wraps constants in stateless lambdas so only a function pointer is needed.