[core] Use a user provided default constructor for Automation (#19197)

This commit is contained in:
J. Nick Koston
2026-09-16 20:42:32 +12:00
committed by GitHub
parent 0d5683525e
commit 0d4c9f3243
+3 -1
View File
@@ -608,7 +608,9 @@ template<typename... Ts> class ActionList {
template<typename... Ts> class Automation {
public:
/// Default constructor for use with TriggerForwarder (no Trigger object needed).
Automation() = default;
// User provided, not "= default": `new(p) Automation()` would zero-fill .bss that is already zero.
// constexpr and noexcept keep the rest of the implicit constructor's contract.
constexpr Automation() noexcept {}
explicit Automation(Trigger<Ts...> *trigger) { trigger->set_automation_parent(this); }
void add_action(Action<Ts...> *action) { this->actions_.add_action(action); }