From 561c89143240b647699a2e92f19afb84362d8477 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 26 Oct 2025 12:23:48 -0700 Subject: [PATCH] cleanup --- esphome/core/automation.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/core/automation.h b/esphome/core/automation.h index d357c6f58e..83f0941bac 100644 --- a/esphome/core/automation.h +++ b/esphome/core/automation.h @@ -27,21 +27,20 @@ template class TemplatableValue { public: TemplatableValue() : type_(NONE) {} - template - requires(!std::invocable) TemplatableValue(F value) : type_(VALUE) { + template TemplatableValue(F value) requires(!std::invocable) : type_(VALUE) { new (&this->value_) T(std::move(value)); } // For stateless lambdas (convertible to function pointer): use function pointer template - requires std::invocable && std::convertible_to TemplatableValue(F f) + TemplatableValue(F f) requires std::invocable && std::convertible_to : type_(STATELESS_LAMBDA) { this->stateless_f_ = f; // Implicit conversion to function pointer } // For stateful lambdas (not convertible to function pointer): use std::function template - requires std::invocable &&(!std::convertible_to) TemplatableValue(F f) : type_(LAMBDA) { + TemplatableValue(F f) requires std::invocable && !std::convertible_to : type_(LAMBDA) { this->f_ = new std::function(std::move(f)); }