mirror of
https://github.com/esphome/esphome.git
synced 2026-09-14 08:38:39 +00:00
Merge branch 'integration' into memory_api
This commit is contained in:
@@ -133,10 +133,12 @@ template<typename T, typename... X> class TemplatableValue {
|
||||
case VALUE:
|
||||
return this->value_;
|
||||
case STATIC_STRING:
|
||||
// if constexpr required: code must compile for all T, but STATIC_STRING
|
||||
// can only be set when T is std::string (enforced by constructor constraint)
|
||||
if constexpr (std::same_as<T, std::string>) {
|
||||
return std::string(this->static_str_); // Convert to string only when needed
|
||||
return std::string(this->static_str_);
|
||||
}
|
||||
[[fallthrough]];
|
||||
__builtin_unreachable();
|
||||
case NONE:
|
||||
default:
|
||||
return T{};
|
||||
|
||||
Reference in New Issue
Block a user